• 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 Upgrading a DLL from 32bit to 64bit

Messages
1,749
Country
unitedstates
I have the source code / file TrafficRadar.DLL from Doug Dawson website. Download

This is open source as long as you give credit to the original developer Arne Bartels.

I have no issues loading this source code into Visual C++ 2017 and exporting as a x64 platform. But P3D V4 will crash. (Also make sure you create a DLL.cfg in APPDATA to load the DLL for testing.)

So i realize the platform conversion is easy but there must be some code that needs to suit P3D V4. Any C++ coders can help would be appreciated.
I was thinking maybe the XML_TOKEN list is wrong. I also looked for a AI list whichi could not find as this would not be the same list.

Thanks,
 
I myself have run into an issue with what I believe is a problem with calling conventions.
The module loads fine into P3D. However, if an xml gauge accesses the MyGaugeCDrawable::Draw method, the module crashes when the method returns. The error indicates a stack corruption.
Anyone have any thoughts as to how to track something like this down?
 
Look for pointers being cast into 32bit integers. Make a type definition based whether X64 is active that will automatically switch between a 64bit integer and a 32bit integer and use that type for the integer castings. Or use UINT_PTR which also automatically switches.
 
Look for pointers being cast into 32bit integers. Make a type definition based whether X64 is active that will automatically switch between a 64bit integer and a 32bit integer and use that type for the integer castings. Or use UINT_PTR which also automatically switches.

Can you explain in a more simple way. I do not code in C++. But i do use VB 2017 and it also can export C++. If you could give me an example of what codes to change as a test i can try.
Like unit32 converted to unit64?
I tried doing this and i end up with only 4 errors. But can't fix those errors.
 
If you use the ESP GDI+ example as your template, there will be 3 key areas where you will need to change the UINT32 to a UINT_PTR. The first 2 are the 3rd parameters of your gauge callback function. The last is where the gauge class pointer is stored in the gau struct's userdata member. In the v4 Gauges.h, this is a UINT_PTR, which automatically changes between 32bit and 64bit depending on compiler state, while in the non v4 gauges.h, it is a UINT32. Best bet is to change the cast type from UINT32 to UINT_PTR.
 
Jon,
We're not talking about a gauge here. It is a module, loaded at run time through dll.xml.

DG.
There are a couple of new methods in the gauge, panel and aircraft callback classes that have to be define, even though they are not used:
MyGaugeCCallback::SetPropertyValue(SINT32 id, LPCWSTR szValue)
MyGaugeCCallback::GetPropertyValue(SINT32 id, LPCWSTR* pszValue)
Also, make sure you have expunged all references to fsxgauges_sp2.h
I've got the thing compiling. Just have to get it to stop crashing.
 
Also, make sure you have expunged all references to fsxgauges_sp2.h
I've got the thing compiling. Just have to get it to stop crashing.

_sp2...... It says was to just distinguish the version. So anything can be put there i assume.
And yes i can compile with no issues but it crashes in p3d.

Editing LPCWSTR created more errors.
 
Last edited:
I've finally got something that will survive loading and unloading, but it will require further testing.
I don't think it's quite ready for prime time.
I'll send you a link later today.
 
I've finally got something that will survive loading and unloading, but it will require further testing.
I don't think it's quite ready for prime time.
I'll send you a link later today.

Awesome news. I also thought of making a TCAS using XML coding later this year if we could not pull this off. I figure it would be simple compared to C++.
 
Back
Top