Jump to content
Sign in to follow this  
Guest JeanLuc_

Is this possible???

Recommended Posts

I have created a dll app in C# and wanted to import it into C++ to create a gauge with FSX.Can or has this be done? I am newbee when it comes to C++ and creating gauges.Reed


Reed Stough
Managing Partner
REX SIMULATIONS 

website:  www.rexsimulations.com
supportwww.rexaxis.com

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Reed,You can't "import" a program written in one language (C# in your case) into a program in another language (C++ in your case). Although the look alot alike to the untrained eye, they are different. Many things are done for you in the C# environment that you have to do on your own in C++.You can "port" a program, but this involves essentially translating (re-writing) the thing from one language to another.However, C++ is much more complex than C# (which is more akin to Visual Basic), and so it is not a simple thing to do, especially if you have extensively used .NET libraries, which do not exist in C++ (although they do in managed C++).You can, in fact, write a gauge that uses managed code, however this is very advanced as it requires a part of the gauge to be in C, and a part in managed code. This requires very advanced communication between the managed and unmanaged code, called marshalling. Given your question it is definately beyond what you'll want to attempt.Learn C++, and the SimConnect API, and then write your code in C++ using your C# code as a guide. If your code is not making much use of the .NET libraries this should not be to difficult for you.

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

BTW, you can use SimConnect to interface to FSX with SimConnect, without having to use C/C++.

Share this post


Link to post
Share on other sites
Guest JeanLuc_

Hi Reed,yes it can be done: having a application in C++ calling a C# DLL function (and the reverse). But like described below, it may not prove to be very easy when considering the opportunity to convert a C# code to C++ for example.I think Jose Oliveira is probably one of the most knowledgeable programmer in the community in C#, and may better help you at fsdevelopper.comHope this helps!

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