Sign in to follow this  
Guest pellelil

What is the "status" of using SimConnect with C#

Recommended Posts

I have to admit that so far I haven't even looked at the SDK (since I didn't get to install FSX until yesterday). My primary development background is with Borland Delphi, however I'm in the process of moving towards C# (MS VisualStudio). When it comes to Delphi I know how to access MSFS via FSUIPC, however as of now SimConnect is brand new to me.Searching the net for SimCommect/C# I've seen mentioning of bugs and limitaions in the .Net implementation, and problems with C# that apparently should be easier to handle with C++ (I'd realy hate to use C++ over C#).Anyone to comment on the status of "SimConnect using C#". Is it working out of the box?, or will I need some wrapper that iron out potential problems?http://jdtllc.com/images/rcv4bannerbeta.jpgPelle F. S. Liljendal

Share this post


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

If you want to stay in C#, it is possible to write your own wrapper for SimConnect using P/Invoke. Works well although for some of the structures returned, in particular those that contain pointers to pointers, things get a bit complex.Etienne

Share this post


Link to post
Share on other sites

There are some minor functionality differences between the unmanaged version and the managed one, but they are minimal and not typically needed (example, tagged data support).As said above, the "in the box" version works well.Etienne

Share this post


Link to post
Share on other sites

Several SimConnect methods do not work in C# yet. Examples are: 1. ExecuteMissionAction(_GUID) 2. CompleteCustomMissionActionExecute(_GUID) 3. I've been told that others exist :-hmmmNote: The _GUID data types are protected, and I still haven't found a way to access them. These methods are key, if you are trying to manage mission events via C#. The few C# examples that are supplied with the SDK, work ok...

Share this post


Link to post
Share on other sites

The gaps in the .net version of Simconnect can't easily be fixed (need to get new SP), or your can bite the bullet and use Interop to write your own subset of functions you need.Be wary however that the marshaling needed to convert the C/C++ structs to the .NET managed equivalents is often horrific, in particular because of this definite love for pointer arrays of undefined size and undefined type at compile time... These are a (reasonably) easy in C/C++, but in the managed world, even with unsafe pointers, it is entirely torturous.Etienne

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