• 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 Simconnect backwards compatibility

Messages
40
Country
netherlands
Hi i am coding a program for P3D and i want it to support all versions of P3D... And i was wondering if the latest v4 .dll will work on previous versions of p3d (as i cant test because i dont have any older versions installed) ? Or would i need to reference the older dll's for that? and what about for FSX?

Thanks,
kuba
 
To the best of my understanding, no. What I do is compile two dlls, one of which is x86 and uses the FSX simconnect.h/lib, and which works on FSXA/FSX steam/P3D up to version 3. Then I compile another dll x64 with P3Dv4 simconnect.h/lib, which works on v4. I use a compiler switch to accomplish this, with two build configurations which are linked to the correct .libs and use #ifdef statements for the .h files. the FSX build configuration #defines SIM_FSXA, and the P3Dv4 build #defines SIM_P3D4. So my simconnect.h file looks like this:

Code:
#pragma once
///Non-version-specific Simconnect.h file
///
///Includes the correct version-specific Simconnect.h based on the compiler directive

#ifdef SIM_FSXA
#include "Simconnect_FSXA.h" //FSX Acceleration, steam, and P3D version < 4
#elif SIM_P3D4
#include "SimConnect_P3D4.h" //P3D version >= 4
#elif SIM_FSW
#include "SimConnect_FSW.h" //Dovetail Flight Sim World
#endif

This way compiling for one or the other is about a 2-click process.

There may be other ways to do it... Obviously if you wish to use P3D APIs which are not present in FSX, you will have to use the lowest version which supports those APIs, and lose the FSX compatibility.

Farley
 
Hmmm as my program is coded in C# i would have to manually for each version (as my program will be activly updated) compile 3 or 2 versions of the program. And then i would have to find a solution to the update system i have. i would have to have the program check what version it is... if its a 64 bit version with the v4 .dll or an 32 bit .dll... Chaseplane has the compatibility for all sims in 1 program? Any ideas on how they may have done that ?
 
Ahh... I misunderstood what you meant by .dll, I assumed you meant your own but you meant simconnect.dll.

I have never tried this, but it seems to me that in an .exe, it should be possible to compile in all the simconnect versions, then detect which sim is running and open a simconnect client of the appropriate version....
 
I have done some testing and i can use the p3d v3 simconnect.dll for v4 .... so that is 1 problem solved.. but now FSX, any p3d simconnect wont work with fsx, And i'm unable to build the program with both .dll's in use. gonna do some more digging to see if i can somehow compile the code with both dll's ...

EDIT: it doesnt work... i just assumed becuase it connected... but it doesnt work...
 
Last edited:
Hi guys,

I am having a similar question/problem: I am also writing code in C# which is supposed to run at least under FSX:Acceleration, FSX:Steam, P3Dv3 and P3Dv4. So, I also need to reference the different simconnect versions. Right now, I am referencing both, the LockheedMartin.Prepar3D.SimConnect.dll and Microsoft.FlightSimulator.SimConnect.dll and use a switch to determine which functions to call depending on the choosen fs version. This works without a problem for P3Dv3 and FSX:Steam, both of which I am using at my testing machine.

Now, I am planning to deploy my code on a different machine which is running FSX:Acceleration and I simply don't know what is necessary to make this work, as I cannot reference another Microsoft.FlightSimulator.SimConnect.dll in my project. Didn't try it out, yet but wanted to know what might be the best way to make this work in C#, beforehand.

In C++ it is possible to make some sort of conditonal referencing using compiler directives like shown by Farley above, but how to achieve this in C#?

Maybe you got a suggestion for that?

Greets, Benny
 
How did you reference both in one project ? i cannot have 2 using statements (p3d & fsx) and then build the program... it just fails to build ....
 
Yes, I was having the same problem...I am referencing them both and then not doing:

C#:
using LockheedMartin.Prepar3D.SimConnect;
using Microsoft.FlightSimulator.SimConnect;

Instead, I am doing it like shown in this snippet:

C#:
private LockheedMartin.Prepar3D.SimConnect.SimConnect simConnect_P3Dv3;

private Microsoft.FlightSimulator.SimConnect.SimConnect simConnect_FSXSteam;

      private void SimConnect_Initialization()
      {
        switch (fsVersion)
          {
            case "P3Dv3":
            {
                  simConnect_P3Dv3.OnRecvOpen += SimConnect_OnRecvOpen;

                  simConnect_P3Dv3.OnRecvQuit += SimConnect_OnRecvQuit; 
            }
            break;
                  
            case "FSXSteam":
            {
                  simConnect_FSXSteam.OnRecvOpen += SimConnect_OnRecvOpen;

                  simConnect_FSXSteam.OnRecvQuit += SimConnect_OnRecvQuit;
            }
            break;
        }
    }

Might be clumsy, but I don't know any other way, yet.

Greets, Benny
 
Hi,

As per C++, I can confirm that a single DLL is useable MSFSX-P3D v3. v4 needs a separate one, however, the code is the same, just the compilation is different.

Reference wise, obviously the v4 one references 64bit everything, however, for the 32bit platform, I only ever refer to a single DLL, which is if I am not mistaken, FSX SP2 one.

So try just using the furthest back one DLL you can, that would be Accelerate in your case.
 
Back
Top