• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 GDIPlus Gauge Assert Failed [SOLVED]

When you delete your inquiry and the solution that you found for it, devs having the same problem (which is still stated in the thread title) will be left hanging.

So what was the problem and what did you do to fix it?
 
Sorry can’t find anywhere to delete the thread.

Using the ESP/Virtuali example, after changing everything to match the new 64bit header, I would get an assertion warning, which mentioned userdata == 0.

The example, does a reinterpret_cast to UINT32, whereas it’s now a UINT_PTR, making the sim crash on loading the aircraft, changing the cast to UINT_PTR, for me this results in a assert error as it’s writing to the pointer, rather than what it’s pointing to.

To bypass this I merely removed the assert call, and have so far, found no issues.

Unless anyone has found a better solution, then I’ll keep looking into it. I suspect to have the assert back in, that the pointer will have to be evaluated and then the assert done to that?
 
Last edited:
See, that's some useful info right there. Why delete it in the first place?
 
See, that's some useful info right there. Why delete it in the first place?

The moment of embarrassment, of such a stupid solution, meant the thought didn’t cross my mind.

Again apologies, you raise a obvious and valid point.

:oops:
 
The moment of embarrassment, of such a stupid solution, meant the thought didn’t cross my mind.

Oh please, I can't count the amount of times that I've answered my own questions in here on two hands.
There's absolutely no need to be embarassed about that.
 
What about doing this?
Code:
#ifdef _64BIT
    #define PUSERDATA UINT_PTR
// and anything else exclusively 64-bit
#else
    #define PUSERDATA UINT32
// and anything else exclusively 32-bit
#endif
and then changing your gauge callbacks to read:
Code:
void FSAPI    myGauge_update (PGAUGEHDR pgauge, int service_id, PUSERDATA extra_data)
If you use gauge templates (as I do) then no more nasty error messages when changing platforms.

Oh - and thanks to Jon for the original code!
 
Good catch there on the gauge callback Dai. I don't think the user is using the v4 gauges.h which he should be using.
 
The UINT32 is in GDIPlus_Gauge.h not gauges.h. In gauges.h the user_data variable is declared as UINT_PTR and in GDIPlus_Gauge.h id's being cast as a UINT32... which it no longer is.
 
If I've understood that correctly (which could be doubtful! :)) then a similar #ifdef in that section of the GDIPlus_Gauge.h should also work?
 
True... just wanted everyone to be clear that the actual gauges.h file does not have the error.
 
Back
Top