SimConnect_GetLastSentPacketID

BenBaron
Posts: 72
Joined: Fri Jan 16, 2015 7:51 am

SimConnect_GetLastSentPacketID

Postby BenBaron » Wed Sep 26, 2018 6:10 pm

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: 72
Joined: Fri Jan 16, 2015 7:51 am

Re: SimConnect_GetLastSentPacketID

Postby BenBaron » Fri Sep 28, 2018 10:31 am

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


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 3 guests