[RESOLVED] Question about C# vs. C++ development in P3D

Kleblanc24
Posts: 3
Joined: Mon Jun 10, 2019 6:34 pm

[RESOLVED] Question about C# vs. C++ development in P3D

Postby Kleblanc24 » Tue Jun 11, 2019 4:54 pm

Hello, I have searched this forum a bit to look for more specific answers, so pardon me if this has been explained already. I read over the documentation, and I noticed that you can develop in C++ and C# for P3D. I am interested in using C#, since I know the language better. However, the documentation explains that you can use C# for anything using the "managed layer". I've looked for what that specifically means, and I haven't found any more direct answers though. If anyone could better tell me what the managed layer is, or the range of things I'd be able to do in C# vs C++, I'd very much appreciate it! I don't need a giant list of features, but I'm new here and don't know much at all about P3D, so I feel a bit lost. A general idea of what the difference is in more specifics would be awesome. Thank you very much for any assistance.

BenBaron
Posts: 63
Joined: Fri Jan 16, 2015 7:51 am

Re: Question about C# vs. C++ development in P3D

Postby BenBaron » Wed Jun 12, 2019 2:30 pm

Hi,

well...there is a managed layer available that lets you use C# as the language of your choice.

Basically, just reference LockheedMartin.Prepar3D.SimConnect in your project and you are ready to interface with P3D via SimConnect. However, this is limited to an external program.

So, if you wanted to develop a .dll or a gauge (which is basically also a .dll), which get loaded by P3D, you cannot use C#. You'd have to use C++, with C++/CLI maybe also being possible. But I didn't fiddle around with this much, yet.

With an internal module, you don't have to use SimConnect, you can also make use of the PDK for interfacing.

In general, it is mainly about what you want to achieve...most of the things can be done via SimConnect and the PDK, vice versa, so you won't be limited by functionality, most of the time.

However, if you intend to make use of the newer features like e.g. render-to-texture, you'd have to use the PDK, as SimConnect doesn't provide this as of yet...or at least I am not aware of it.

Maybe this gets you started.

All the best,

Benny

Kleblanc24
Posts: 3
Joined: Mon Jun 10, 2019 6:34 pm

Re: Question about C# vs. C++ development in P3D

Postby Kleblanc24 » Wed Jun 12, 2019 3:46 pm

Hi,

well...there is a managed layer available that lets you use C# as the language of your choice.

Basically, just reference LockheedMartin.Prepar3D.SimConnect in your project and you are ready to interface with P3D via SimConnect. However, this is limited to an external program.

So, if you wanted to develop a .dll or a gauge (which is basically also a .dll), which get loaded by P3D, you cannot use C#. You'd have to use C++, with C++/CLI maybe also being possible. But I didn't fiddle around with this much, yet.

With an internal module, you don't have to use SimConnect, you can also make use of the PDK for interfacing.

In general, it is mainly about what you want to achieve...most of the things can be done via SimConnect and the PDK, vice versa, so you won't be limited by functionality, most of the time.

However, if you intend to make use the newer features like e.g. render-to-texture, you'd have to use the PDK, as SimConnect doesn't provide this as of yet...or at least I am not aware of it.

Maybe this gets you started.

All the best,

Benny
That certainly gets me started, I appreciate it! I suppose I should've explained better what I'm trying to achieve, but I was a little confused on where to go at first. The documentation is good, but it's a lot to take in. I think most of what I'm trying to achieve I'd be able to do within an external program using C#. I noticed that things like gauges must be done in C++/XML. I think I can manage to figure out the XML enough to make any gauges if needed, among other things that can't be done in C#. Thanks again for the assistance.

Emily_Simmons
Posts: 2
Joined: Fri Jun 14, 2019 2:06 pm

Re: Question about C# vs. C++ development in P3D

Postby Emily_Simmons » Fri Jun 14, 2019 2:19 pm

Thank you so much for these useful tips!


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 3 guests