Jump to content

Simconnect, local connection problem.


Recommended Posts

Posted

I am migrating from win7 to win10.

All my programs(made by me) work ok locally and remotely with FSX on win7.

With FSX on win10 they only work remotely(test from win10 computer). Locally they don't connect to FSX, however Little Navmap do.

Searching the internet I only find problems related to remote connections.

Anyone else having this issue with Simconnect / Windows 10 and local connection?

Any ideas?

Thanks!

  • FSX with sp2.
  • Simconnect version 10.0.61259.0
  • C# programs, Visual Studio 2017, .NET 4.7
  • Windows 10 64 bits
  • No antivirus.
  • Windows Defender off.
Posted

Finally I found the problem.

When instantiating simconnect, the value 1 are passed to the last parameter (configIndex) of the constructor:

_simConnect = new SimConnect("XPDR_ADF", _windowHandle, WM_USER_SIMCONNECT, null, 1);

I changed it to 0 and now it connects.

Now, I just have to implement a way for the user to inform if the connection is local or remote.
Or check if FSX is installed.

It remains to be seen why in Win7 it will be possible to pass the value 1 even for local connections.

  • 2 weeks later...
  • Commercial Member
Posted
On 10/5/2020 at 12:31 AM, samtron said:

I changed it to 0 and now it connects.

This index corresponds to the configurations in the simconnect.cfg. If there is no simconnect.cfg (as is the norm on the "server" where your sim is running), I think that it defaults to "0". 

You could just create a simconnect.cfg with a localhost config using the proper index and you wouldn't have to change your sources. 

From the good old fsxsdk.chm documentation:

Quote

The SimConnect.cfg file

The SimConnect.cfg file contains communications information for a client (the SimConnect.xml file contains information for a server). This file is only required if a client is going to access Flight Simulator running on a remote machine, and should be placed in the My Documents folder, or in the same folder as the client application or library, on the computer the client is running on. Also make sure to run the SimConnect.msi installer on the remote client machine which installs the WinSxS library, found in the \lib folder.

The SimConnect.cfg file can contain a number of configurations, identified in sections with the [SimConnect.N] title. The index number is used as a parameter in the SimConnect_Open function. This is useful for applications that communicate with a number of different machines that are running Flight Simulator. The default configuration index is zero, and if there is only one configuration in the file, no index number is required.

 

Best regards

LORBY-SI

  • 4 weeks later...
Posted

Hi, Lorby_SI.

Thanks for your support and sorry for my late reply. Only today I saw your post.

You're right.

Simply place a Simconnect.cfg in the FSX computer Documents folder, like the one below, for the application to connect, both remotely and locally.

 

[SimConnect.1]
Protocol=Auto
Address=127.0.0.1
Port=
MaxReceives=4096
DisableNagle=0

Thanks again.

Archived

This topic is now archived and is closed to further replies.

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...