Jump to content
The simFlight Network Forums

PMDG events via Visual Basic 6


Dominik

Recommended Posts

Yes, I'm quite sure it's possible. I don't have VB6 any more, so I can only tell you the method, I can't give you any working code.

1. You'll need to use two offsets: 

&H3114 - This should be 4 bytes and an integer (Long in VB6) - This is the 'Parameter Value'

&H3110 - This should also be 4 bytes and an Integer - This is the 'Control (or Event) Number'

You MUST write 3114 first, then 3110. You can write both in the same process() call, just make sure 3114 goes first.

 

To send an event to PMDG, you need the list of events from the .h file in the SDK. (PMDG_NGX_SDK.h I think)

 

2. If I remember correctly, the parameter is set to one of the codes for the mouse buttons.

Here is an example line from the .h file

#define MOUSE_FLAG_LEFTSINGLE    0x20000000

So, to send a single left mouse click you set the value of 3114 to &H20000000

 

3. The control (or Event) number is also in the .h file:

To get the full number you need to add the event number to the value of THIRD_PARTY_EVENT_ID_MIN (69632)

Here is another example line from that file...

#define    EVT_MCP_CMD_A_SWITCH                    (THIRD_PARTY_EVENT_ID_MIN + 402)

To send the event for the MCP autopilot CMD A switch you need 69632 + 402 = 70034

 

In summary:

To send a single left mouse click to the CMD A autopilot button on the MCP:
 

Write &H20000000 to offset &H3114
Write 70034 to offset &H3110
Process().

 

Paul

Link to comment
Share on other sites

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.