Jump to content
Sign in to follow this  
Guest rodrigofarias77

Translating samples to C#

Recommended Posts

Guest rodrigofarias77

I would like to know if somebody has the C# version of some C++ samples of SimConnect SDK. I got to translate some samples to C#, but the Throttle Control is more complex to me...The tutorials of NotASenator where very important to understand a lot of concepts related to the C# interface of SimConnect. It seems the next one (Part 5) will deal with some details of Throttle Control C++ example.RegardsRodrigo

Share this post


Link to post
Share on other sites
Guest jkvato

I've been tinkering a little bit with SimConnect in C#, so I decided to take up this example.I had to get a little creative with some SimConnect calls because in C# you have to use all method parameters, whereas in C++ you can omit them and use the default parameter values.The C++ example maps event IDs to the down keypress events, and by omitting parameters, ignores the up keypress events. But, I couldn't do that, so I had to create another key event to map the up-key events. This is explained a little bit in the commentary in my code.The C++ example uses the A and Z keys to control the throttle, but I used the Q and Z keys instead. This is because the A key was also changing the current view, which made testing a bit difficult.I hope that my example is helpful to you. You may need to respecify the location of the SimConnect Reference in the Visual Studio IDE.Good luck!Johnhttp://forums.avsim.net/user_files/176646.zip

Share this post


Link to post
Share on other sites
Guest rodrigofarias77

Thank you, John! It was very useful. If you have other sample codes, please share them.RegardsRodrigo

Share this post


Link to post
Share on other sites
Guest kranky22

Thanks a lot for this. Is it just me, or is finding C# examples for simconnect difficult? Is there a place specfically for C# simconnect examples? If not, this or one like it would be helpful to a lot of users. Besides us few, is there any interest in sharing C# examples? Reply if so, we can all help each other out.Kranky

Share this post


Link to post
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
Sign in to follow this  

  • 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...