P3D v2 Access different versions of SimConnect from managed code

#1
In the past I've worked a lot with FSUIPC, and I like its simplicity (that the same Addon's can access different versions of FS), however there are many things you cannot acess from FSUIPC. So therefor I have just begun look at the Prepar3d (v2.5) SDK, and I am trying to learn how to access P3D via SimConnect (software written in C#).

I am courious as to how I can write a C# program that will work with both FSX, FSX:SE and P3D. Any one who can enlighten me, and/or show an example solution?

Pelle
 

ddawson

Resource contributor
#4
One thing to keep in mind. The FSX-SP2 version of SimConnect will work with FSX-SE and with P3D, provided it is installed on the user's machine. As such, the easiest thing to do will be to work with only that version of SimConnect. You are then limited to the features provided by that version, but if you want the same app to work on all platforms, you'll have to stick those features available within FSX in any event.
If you want to determine, programmatically, which version of SimConnect to use, then you have to make that decision before you load the appropriate manifest (if you are loading an FSX version of SimConnect; the P3D version does not require a manifest.) That's what Jean-Luc's code, in that link, is all about.
 
#5
Now that was interresting, that FSX-SP2 will work with multiple versions (I did not know that). I would like to target FSX, FSX:SE and P3D, and I guess the things I need are "basic" enough for the features of this version being ok.
 

ddawson

Resource contributor
#6
Keep in mind that for FSX-SE and P3D, the FSX-SP2 version of SimConnect is not an automatic install, although it does (I believe) ship with both of those sims.
You will need to ensure that your users understand the need to have SimConnect from SP2 installed.
 
#7
So far I only have a small test-app, and it was a quick fix referencing the SimConnect from the "FSX-SP2-XPACK" folder in stead of the P3D SimConnect. However it required me to target my app at .Net 2.0 in stead of .Net 4.0. But doing so and recompiling the app worked.
 
#8
Keep in mind that for FSX-SE and P3D, the FSX-SP2 version of SimConnect is not an automatic install, although it does (I believe) ship with both of those sims.
You will need to ensure that your users understand the need to have SimConnect from SP2 installed.
Can't answer for FSX-SE, but the redist folder in P3D (v2.5 at least) contains: "FSX-RTM", "FSX-RTM-JPN", "FSX-SP1", "FSX-SP1-RUS" and "FSX-SP2-XPACK".
 
#9
On FSX + Acceleration there are 3 versions of SimConnect.h. Tthe first one is for acceleration, the other, legacy versions are obvious.
Code:
C:\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Core Utilities Kit\SimConnect SDK\inc
C:\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Core Utilities Kit\SimConnect SDK\LegacyInterfaces\FSX-SP1
C:\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Core Utilities Kit\SimConnect SDK\LegacyInterfaces\FSX-RTM[
Each version of SimConnect.h contains the lines
Code:
#ifndef SIMCONNECT_H_NOMANIFEST
#if _MSC_FULL_VER >= 140040130
#ifdef _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
  "name='" "Microsoft.FlightSimulator.SimConnect" "' " \
  "version='" "10.0.61259.0" "' " \
  "processorArchitecture='x86' " \
  "publicKeyToken='" "67c7c14424d61b5b" "'\"")
#endif
#endif
#endif  //SIMCONNECT_H_NOMANIFEST
which links in the appropriate version of Simconnect.lib.
 
Top