FSW Flight sim world and sim connect 64 bit

Hacking, or did you just dynamically load the DLL and get the functions in the same format as the old SimConnect (with LoadLibrary() and GetProcAddress())?
Okay, I got my SimConnect DLL project converted over. It connects to FSW just fine, appears in the addon menu, receives data and events, etc. I haven't tested every SimConnect function though.

The instructions how to do it are at the top of the attached file, but basically save the whole thing as a new header file, and include that instead of simconnect.h (and don't link to simconnect.lib). It's basically FSX's simconnect.h except the linked functions are wrapped in a class called CFSWSimConnect that extracts them out of SimConnect.dll at runtime.

Then in your project you create an instance (e.g. CFSWSimConnect SimConnect) that everybody who needs it can see, and find-and-replace SimConnect_ with SimConnect. ("dot") to call the new class instead of the function.

Then recompile your project to 64 bits (in Visual Studio 2015, right-click the project name in solution explorer, Properties, under Platform choose "x64", make sure the include directories, output path, and any other settings you changed in the Win32 platform are correct, apply, then in the top toolbar change the Solutions Platform window to "x64", cross your fingers and build).

If you're doing voodoo with pointers and funny casting tricks you may run into problems, but I only had a few type conversion warnings going to 64 bit that were easily fixed.



Resource contributor
I adopted the code from here http://www.fsdeveloper.com/wiki/index.php?title=SimConnect_-_Accessing_from_VB and successfully connected VB with FSW.
    <DllImport("SimConnect.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Ansi)>
    Shared Function SimConnect_AddToDataDefinition(
                                                  ByVal hSimConnect As Int32,
                                                  ByVal DefineID As Int32,
                                                  ByVal DatumName As String,
                                                  ByVal UnitsName As String,
                                                  ByVal DatumType As Int32,
                                                  Optional ByVal fEpsilon As Single = 0,
                                                  Optional ByVal DatumID As Int32 = 0) As Int32
    End Function

    <DllImport("SimConnect.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Ansi)>
    Shared Function SimConnect_Open(ByRef hSimConnect As UInt32, ByVal AppName As String, ByVal hWnd As UInt32, ByVal UserEventWin32 As UInt32, ByVal hEventHandle As UInt32, ByVal ConfigIndex As UInt32) As UInt32
    End Function

    <DllImport("SimConnect.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Ansi)>
    Shared Function SimConnect_GetNextDispatch(ByVal hSimConnect As Int32, ByRef ppData As IntPtr, ByRef pcbData As IntPtr) As Int32
    End Function

    <DllImport("SimConnect.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Ansi)>
    Shared Function SimConnect_RequestDataOnSimObject(ByVal hSimConnect As Int32,
                                                      ByVal SIMCONNECT_DATA_REQUEST_ID As Int32,
                                                      ByVal SIMCONNECT_DATA_DEFINITION_ID As Int32,
                                                      ByVal SIMCONNECT_OBJECT_ID As Int32,
                                                      ByVal SIMCONNECT_DATA_REQUEST_FLAG As Int32,
                                                      ByVal origin As Int32,
                                                      ByVal interval As Int32,
                                                      ByVal limit As Int32) As Int32
    End Function

    <DllImport("SimConnect.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Ansi)>
    Shared Function SimConnect_RequestDataOnSimObjectType _
      (ByVal hSimConnect As UInt32,
       ByVal RequestID As Int32,
       ByVal DefineID As UInt32,
       ByVal dwRadiusMeters As UInt32,
       ByVal ObjectType As UInt32) As UInt32
    End Function

    <DllImport("SimConnect.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Ansi)>
    Shared Function SimConnect_Close(ByVal hSimConnect As Int32) As Int32
    End Function
        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)>
        Dim szApplicationName As String
        Dim dwApplicationVersionMajor As Int32
        Dim dwApplicationVersionMinor As Int32
        Dim dwApplicationBuildMajor As Int32
        Dim dwApplicationBuildMinor As Int32
        Dim dwSimConnectVersionMajor As Int32
        Dim dwSimConnectVersionMinor As Int32
        Dim dwSimConnectBuildMajor As Int32
        Dim dwSimConnectBuildMinor As Int32
        Dim dwReserved1 As Int32
        Dim dwReserved2 As Int32
    End Structure
CopyMemory Recv, ByVal pData, Len(Recv)
pData = pData + Len(Recv)
Recv = Marshal.PtrToStructure(pData, GetType(SIMCONNECT_RECV))
pData = pData + Marshal.SizeOf(Recv)


Resource contributor
Hi @rhumbaflappy
Here is an example project for VS2015. Make sure the DllImports show the correct path to the location of your SimConnect_x86.dll
<DllImport("D:\Games\Steam\SteamApps\common\FSW\SimConnect_x86.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Ansi)>. Start FSW, FSW_SimConnect.exe and then click on the Start button. Please let me know if it works.



Staff member
Resource contributor
Altered code:
<DllImport("SimConnect_x86.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Ansi)>

And copied SimConnect_x86.dll to the same folder. Also, it compiled as 64-bit with SimConnect.dll and works fine, with that DLL copied to the same folder. I used VS2017 Community. Very nice work.


Staff member
Resource contributor
I rewrote TCalcX as TCalcFSW, and have a working solution for FSW in 64 bits. Many thanks to "value1". Code included for Visual Studio Community 2017 (written as C#):



Staff member
Resource contributor
A post by vincent32 got me thinking about setting a SLEW command to FSW:

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "SimConnect.h"
#include <strsafe.h>

int quit = 0;
HANDLE hSimConnect = NULL;

static enum GROUP_ID {

static enum EVENT_ID {

void testSendEvent()
    HRESULT hr;

    if (SUCCEEDED(SimConnect_Open(&hSimConnect, "FSW Slew", NULL, 0, 0, 0)))
        MessageBox(NULL, _T("SimConnected! \n \n Mapping the Client event... \n \n Transmitting the Client event..."), _T(""), MB_OK | MB_SYSTEMMODAL);

        hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_SLEW_ON, "SLEW_ON");
        hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, MyGroup, EVENT_SLEW_ON);
        hr = SimConnect_SetNotificationGroupPriority(hSimConnect, MyGroup, SIMCONNECT_GROUP_PRIORITY_HIGHEST);


        MessageBox(NULL, _T("Slew set!"), _T(""), MB_OK | MB_SYSTEMMODAL);

        hr = SimConnect_Close(hSimConnect);

//int __cdecl _tmain(int argc, _TCHAR* argv[])

// Hides the console window
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
    return 0;
Change the 'Start in" path in the shortcut I made to your root FSW folder, and you won't need to copy the SimConnect.dll:


This thread https://www.fsdeveloper.com/forum/threads/c-clr-windows-forms.442294/ has a Windows Form C++/CLR version.


Last edited: