SimConnect_GetLastSentPacketID

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Post Reply
BenBaron
Posts: 80
Joined: Fri Jan 16, 2015 7:51 am

SimConnect_GetLastSentPacketID

Post by BenBaron »

Hi all,

how are we supposed to run SimConnect_GetLastSentPacketID from a managed client in C#?

Until now, I was using

Code: Select all

[DllImport("SimConnect.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
         private static extern int SimConnect_GetLastSentPacketID(IntPtr hSimConnect, out UInt32 dwSendID);
to call the function directly from the SimConnect.dll.

But as I was not able to find a x64 version of SimConnect.dll to include it into my program, the above mentioned approach doesn't work any more.

Any suggestions?

Greets, Benny
BenBaron
Posts: 80
Joined: Fri Jan 16, 2015 7:51 am

Re: SimConnect_GetLastSentPacketID

Post by BenBaron »

Ok...I found it out myself.

In case someone runs into the same problem of some functionality not being available in managed simconnect and no native SimConnect.dll at hand:

Create a new C++ .dll project, include the SimConnect.h file and link to SimConnect.lib. Add a definition file to the project and export the functions you want to use (in my case SimConnect_GetLastSentPacketID). Then you can build your own SimConnect.dll and use the DLLImport in your managed project like shown in the op.

Greets, Benny
Post Reply