March 30, 200422 yr Author 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
March 30, 200422 yr 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
March 30, 200422 yr Author 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
January 18, 200521 yr 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?
January 18, 200521 yr Moderator >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
January 19, 200521 yr Thanks! this is what I thought but reading this thread I was not sure. Now I am!
Create an account or sign in to comment