Hi,
I need to remotely connect to P3D via SimConnect. I have 2 PCs.
Server: PC1 with P3D v4 installed, IPv4:192.168.10.139
Client: PC2 has a C# WPF app that does some reading & writing to P3D on PC1 via SimConnect. IPv4:192.168.10.167
I have put SimConnect.cfg file on PC2, Documents folder, put SimConnect.xml, EXE.xml and DLL.xml files on PC1, C:\Program Files\Lockheed Martin\Prepar3D v4 folder, put SimConnect.ini file on PC1, C:\Users\Administrator\Documents\Prepar3D v4 Files folder. I save all these 5 files as Unicode type for encoding.
In SimConnect.cfg:
In SimConnect.xml:
In SimConnect.ini:
As for EXE.xml and DLL.xml files, I didn't do any changes as I found no instructions about them.
In the WPF app code on PC2:
private const int WM_USER_SIMCONNECT = 0x0402; //user-defined
this.SimConnect = new SimConnect("Managed Data Request", Handle, WM_USER_SIMCONNECT, null, 0); // it can be executed with no error or exception as long as the SimConnect.cfg file is OK.
private IntPtr HandleSimConnectEvents(IntPtr hWnd, int message, IntPtr wParam, IntPtr lParam, ref bool isHandled)
{
isHandled = false;
switch (message)
{
case WM_USER_SIMCONNECT:// This is never met! But if P3D and the WPF app run on the same PC then it works.
{
if (SimConnect != null)
{
try
{
this.SimConnect.ReceiveMessage();
}
catch
{
RecoverFromError();
}
isHandled = true;
}
}
break;
default:
break;
}
return IntPtr.Zero;
}
The remote connection between P3D and the WPF app is not successful. I appreciate any help.