• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

New SimConnect API for C#

[If the below feels like I am a "Grumpy old man" then please humor me. 57 years and developing since before the 8086 and 8088 came around should entitle me to that. I still have the TRS-80 version of Flight Simulator somewhere, if the floppy is still readable]

I am a reasonably experienced developer in C/C++, a very experienced one in Java, and a beginner in C#. My background is mostly server-side with quite a bit of HTML UI interfacing, but only some (very) limited experience in old-school Windows UI interfacing. I have done some experiments with C++ and SimConnect, but my sense of "Good Programming" led me to immediately hide the (IMHO) ugly SimConnect API in a few classes, using multi-threading to take care of the communication. Send in a request that will eventually get me a reply in the stream of messages? Good, that's a "Future" and I'll provide a lambda to pick up the reply whenever it comes. Works beautifully, until I want a UI.

Writing UIs in Windows is a total mess. The Windows XP age is definitely gone, so I'd rather not go down the path of CWindows and CDialogs, which are still supported and happily used by a lot of FlightSim tools I see around but force me to constantly worry about their implementation details. Also, the messaging infrastructure of Windows keeps rearing its ugly head in the most unfortunate places, which forces you to lug HWND values around even if you don't care about using anything graphical. C# and XAML are a lot closer to what you'd want to use nowadays, but make the wrong choice when you create the project and your application won't run until you send it in for distribution through the Microsoft Store. Don't mind, to be honest, but the hassle of registration and packaging takes the fun out of it quickly.

So Microsoft is now into .Net and the CLR, with C# (and to some degree F#) as the big stars, and there is even DotNet Core which allows you to (somewhat) forget Windows altogether and create applications that are (source) compatible across platforms, allowing you to write something that will work on Linux and macOS just as well as on Windows, meaning I can write server software that does not need a monitor and mouse/keyboard combo to work. XAML UIs even work using Xamarin, so that is actually pretty neat. Great, but SimConnect is stuck in the past. There is a network protocol for it; must be because I can connect across networks to Prepar3D (and probably/eventually MSFS), but it is not very well documented or at least not well published. Somebody wrote "jsimconnect", so there is a reverse-engineered Java implementation of it, but let's not go into that... for now.

So I took a look at the Prepar3D documentation for the Managed Code version of SimConnect, and it is like someone grudgingly acknowledged that such a thing needs to exist, but let's not put too much effort into being fancy about it. Maybe they're still mad that Adobe finally pulled the plug on Flash (didn't that feel like a relief?) just when they were set to allow Flash gauges.

So, time to do some serious Software Architecting and Developing, which is what my daytime job states I should do, and find or build something that means I can do productive and modern software development while communicating with a flight simulator. Am I duplicating efforts here? I am not intending to build a commercial empire around this, so my intention is that all the source code will end up on GitHub.

Bert Laverman
 

rhumbaflappy

Administrator
Staff member
Resource contributor
I don't believe you are duplicating anyone's efforts. Long ago we had an implementation in Delphi. And beetle (one of the MS Aces) had a C# solution, but that has disappeared I think.
 

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
There is at least one C# library for FSUIPC connectivity. But I am not aware of a C# library for SimConnect. In any case we are always better for having more than one solution to give users a choice
 
What they are able to get from the outsourcing company is a team of web developers who are highly specialized in the field of web applications and are well versed in the use of different programming languages. For example mlsdev.com. There are a lot of developers who work in an outsourced environment and this results to a higher degree of efficiency.
 
Last edited:
Top