Problem with SimConnect SP1A and P3DV4

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Locked
ctroncy
Posts: 47
Joined: Mon Mar 14, 2016 7:11 pm

Problem with SimConnect SP1A and P3DV4

Post by ctroncy »

Bonjour,

Windows 7 Home Premium 64 bits.
I already talked about my problem in other topics but I think it will be easier for LM admin to help me with only one topic.

I have a 32 bit exec application which use SimConnect SP1A, it was working perfectly in P3DV3 but not in P3DV4.
This application is no longer maintained by the developper, and I woulk like to find a solution.
As it was working in P3D V3, I understand it should also work in P3D V4 as it is an external 32 bit exec.

I made a lot of investigation and wrote a little program which only do an Simconnect_open.
//------------------------------------------------------------------------------
//
// SimConnect Test open
//
//------------------------------------------------------------------------------

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

#include "SimConnect.h"

int quit = 0;
HANDLE hSimConnect = NULL;

void testOpen()
{
HRESULT hr;

hr = SimConnect_Open(&hSimConnect, "Test Open", NULL, 0, 0, 0);
printf("%X",hr);
if (hr == S_OK)
{
printf("\nConnected to Flight Simulator!");
} else {
printf("\nNot Connected to Flight Simulator!");
}

while( 0 == quit )
{
Sleep(1);
}

hr = SimConnect_Close(hSimConnect);
}

int __cdecl _tmain(int argc, _TCHAR* argv[])
{
testOpen();
return 0;
}
With SP1A SDK environnement
It works perfectly in P3DV3 with a return code 0 for the SimConnect_Open function
In P3DV4 the return code is 80004005 which is not easy for me to diagnose.

With SP2 SDK environnement
No problem at all it works with both P3DV3 and P3DV4.

Thank you very much for your help.
Cheers
Claude
DukeSan27
Posts: 212
Joined: Sun Aug 17, 2014 6:27 am
Location: Dallas/Texas

Re: Problem with SimConnect SP1A and P3DV4

Post by DukeSan27 »

I confirm the same issue from a managed application.

SP2 works fine, as reported.
Win10 / 7900X@4.7 / 32GB / 2x1080Ti SLI / 3x 4K 40" Samsung
Orbx FTX Global Base + Vector + FS Global + UTX USA
REX Texture Direct + AS2016 + ASCA
Saitek X56 + Thrustmaster T.Flight Rudder Pedals
ctroncy
Posts: 47
Joined: Mon Mar 14, 2016 7:11 pm

Re: Problem with SimConnect SP1A and P3DV4

Post by ctroncy »

I hope that LM will at least acknowledge the problem, with the open_simconnect function.
cheers
User avatar
Rob McCarthy
Lockheed Martin
Posts: 3703
Joined: Wed Aug 24, 2011 1:37 pm

Re: Problem with SimConnect SP1A and P3DV4

Post by Rob McCarthy »

We will look into the issue and report back.

Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
User avatar
WarpD
Posts: 1469
Joined: Mon Feb 14, 2011 5:29 am

Re: Problem with SimConnect SP1A and P3DV4

Post by WarpD »

Have you tried using SIMCONNECT_OPEN_CONFIGINDEX_LOCAL as the final parameter in your Open call?
Ed Wilson
Senior Developer
Mindstar Aviation
ctroncy
Posts: 47
Joined: Mon Mar 14, 2016 7:11 pm

Re: Problem with SimConnect SP1A and P3DV4

Post by ctroncy »

Hi WarpD,

Thank you for your help.
The SIMCONNECT_OPEN_CONFIGINDEX_LOCAL parameter seems to only exist in SP2 Simconnect, we cannot use it with RTM and SP1.

Cheers
Claude
User avatar
WarpD
Posts: 1469
Joined: Mon Feb 14, 2011 5:29 am

Re: Problem with SimConnect SP1A and P3DV4

Post by WarpD »

It was added in SP2/ACCEL. I am honestly baffled as to why that's not the minimum version supported as no one should be running SP1/RTM due to the significant number of problems in that level of sim release. But... I understand that you can't change the code.
Ed Wilson
Senior Developer
Mindstar Aviation
ctroncy
Posts: 47
Joined: Mon Mar 14, 2016 7:11 pm

Re: Problem with SimConnect SP1A and P3DV4

Post by ctroncy »

Bonjour LM,
For information the problem is still there with hotfix 1.
To resume, with simconnect (RTM and SP1) the Open_Simconnect function only works in a network environnement. Nothing happens in local.
I found a workaround here. http://www.prepar3d.com/forum/viewtopic ... 0&t=125531

Cheers
Claude
dvtx
Posts: 1
Joined: Wed Jul 12, 2017 2:02 am

Re: Problem with SimConnect SP1A and P3DV4

Post by dvtx »

Hi Rob,

This may be related to the problem I am having with v4 SimConnect....

(I am an addon software developer / using SimConnect with multiple network configurations to support attached hardware devices ---- software works with FSX ESP Prepar3D v2 v3 ---- glitch with SimConnect in v4)

For reasons I will not go into, I monitor the SimConnect local TCP connections, using the Port # posted in the Registry:

HKEY_CRRENT_USER\Software\LockheedMartin\Prepar3D\Simconnect_Port_IPv4
HKEY_CRRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\Simconnect_Port_IPv4

These are posted correctly in v2 and v3 BUT ARE INCORRECT IN v4
Locked