Dominik Posted January 22, 2018 Report Share Posted January 22, 2018 Hello,I know how to read and load offsets using Visual Basic. I wonder if it is possible to send PMDG events using Visual Basic? I am using Visual Basic 6.0I will be grateful for your help.Regards,Dominik Link to comment Share on other sites More sharing options...
Paul Henty Posted January 22, 2018 Report Share Posted January 22, 2018 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 More sharing options...
Dominik Posted January 22, 2018 Author Report Share Posted January 22, 2018 Paul, you are great!!! I`ve just tested and it works great!!! Earlier in Visual Basic I used the function of a key (sendkey) and in FSUIPC I assigned the PMDG event to the key.Thank you again and best regards,Dominik Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now