MichalP

PMDG SDK simconnect problem - connect to 2 aircrafts

Recommended Posts

Hello,

I have a small home cockpit and I'm tryinng to write an app to connect my cockpit with Prepar3d (PMDG 737 and 777).

My code:

	enum CLIENT_DATA_777
        {
            PMDG_777X_DATA_ID = 0x4E477831,
            PMDG_777X_DATA_DEFINITION=0x4E477832,
            PMDG_777X_CONTROL_ID	=0x4E477833,
            PMDG_777X_CONTROL_DEFINITION = 0x4E477834,
        };

	enum CLIENT_DATA_737
        {
            PMDG_NGX_DATA_ID = 0x4E477831,
            PMDG_NGX_DATA_DEFINITION=0x4E477832,
            PMDG_NGX_CONTROL_ID	=0x4E477833,
            PMDG_NGX_CONTROL_DEFINITION = 0x4E477834,
        };


(...)

simconnect_MapClientToDataName("PMDG_NGX_Data", CLIENT_DATA_737.PMDG_NGX_DATA_ID);
simconnect_MapClientToDataName("PMDG_NGX_Control", CLIENT_DATA_737.PMDG_NGX_CONTROL_ID);

simconnect_MapClientToDataName("PMDG_777X_Data", CLIENT_DATA_777.PMDG_NGX_DATA_ID);
simconnect_MapClientToDataName("PMDG_777X_Control", CLIENT_DATA_777.PMDG_NGX_CONTROL_ID);

 

The problem is an exception: DUPLICATE_ID. How to solve this? Do I have to close simconnect and open it again with settings for 737 only when 737 is loaded and the same with settings for 777 only when 777 is loaded?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now