Jump to content
Sign in to follow this  
jcboliveira

Visual C++ .NET help

Recommended Posts

YesJust dis a makefile and compile the gauge with it just before release. I have a feelling that some "can't load" that appear from time to time in the foruns are due to this problem.Jos

Share this post


Link to post
Share on other sites
Guest Arnt Helge

Thanks for the help.Jos

Share this post


Link to post
Share on other sites
Guest bartels

You don't have to, C code in cpp files is (more or less) treated as C code. No classes needed. Ther could be some incompabilities, but the gauges.h is prepared to deal with them. Apart from that it's impossible to rewrite the gauge sceleton code to pure C++ in my opinion.So to enable C++ parts just rename to .cpp, the main C code in the gauge isn't touched by this.As a "COM" related interface in the Trafficc example it might be possible to use it also in pure C-code (via the vtbl->... stuff), but I haven't checked.Arne Bartels

Share this post


Link to post
Share on other sites

My personal way is to separate the gauge macros from C++ code. That's why you can find C files and CPP files. The CPP files in the example have one class (waveread.cpp) and Direct Sound code (sound.cpp) that also use that class. And pure Direct Input code (Joystick.cpp) That needs to be in a CPP file.Then when I need to call c++ functions from C just declare it has extern "C".Now I'm trying to do the same by putting C++ code in a dll but don't know why the dll is not loaded by the gauge. But since is only an exercise I didn't see deeply why. The functions are declared has:extern "C" _declspec(dllexport)Jos

Share this post


Link to post
Share on other sites
Guest JeanLuc_

Hans,why is it necessary you use a .def? it looks like the gauges.h uses its own EXTERN_C DECLSPEC_EXPORT for it?could you shed some light about this?

Share this post


Link to post
Share on other sites

>Hans,>>why is it necessary you use a .def? it looks like the gauges.h>uses its own EXTERN_C DECLSPEC_EXPORT for it?Well, neither Ike Slack nor I need the .def file at all. We're both using Visual Studio C++ .NET (although I use the v7.x optimized compiler now).


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest JeanLuc_

Thanks! this is what I thought but reading this thread I was not sure. Now I am!

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