Sign in to follow this  
Guest bartels

Question to C gauge developers

Recommended Posts

You may already know that I have developed many gauges in C. If not, you can have a look at my web site.I'd like to know how I can use Visual C++ environment in a "standard" way to develop C gauges. I mean, instead of using the FS SDK way of including C file into another one (#include "xxx.c"), I'd like to use the multiple source management offered by Visual C++. Instead of re-compiling the whole source code, this allows to re-compile only the modified C files.I don't know how to manage this because the Microsoft macros are quite complex...Thanks for any help !!

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hey Eric.Not sure. I use the #include method. Compiling all the files all over again after changing something in just one file wouldn't take long at all, if not for the thousands of warnings I get (all of them because I am assigning a float value to an integer, so a warning saying "Possible loss of data" shows up for each of them).If I knew how to turn these warnings off I'd be a happier lad!

Share this post


Link to post
Share on other sites

"My way" is to use a subgauge.h file where only the GAUGEHDR is declared. Something like :#ifndef YOUR_SUBGAUGE_NAME_H#define YOUR_SUBGAUGE_NAME_H #undef GAUGEHDR_VAR_NAME #define GAUGEHDR_VAR_NAME gaugehdr_your_subgauge extern GAUGEHDR GAUGEHDR_VAR_NAME;#endif#included from the maingauge.c and the subgauge.c(pp). Then add maingauge.c AND subgauge.c(pp) to the project.I shift the GAUGE_HEADER_FS700 macro to the end of the file to allow to use non-extern declarations of gauge_name, list. I use also "static" declarations of any function and global variable to avoid name conflicts. At last I use a resource.h which includes all defined Bitmap IDS. Unfortunately, you can't split the maingauge.rc in such object targets as the maingauge.c file. I use to #include subgauge.rcs from the maingauge.rcs, not completely proper, but OK.So all .c files to the project, but only one (the maingauge.rc) to the project. I attach a reworked fs2000 SDK sample nas an example. You are free to use .cpp instead of .c or attaching opther .cpp files to the project.Arne Bartels

Share this post


Link to post
Share on other sites

>If I knew how to turn these warnings off I'd be a happier>lad!#pragma warning( disable : 4761 )Change 4761 to whatever number that error message is. ;-)Matt

Share this post


Link to post
Share on other sites

int_variable=(int)float_variable?Arne Bartels

Share this post


Link to post
Share on other sites

Thanks for your explanations, Arne.I am sorry, bt I have one more question:I usually use Visual C++ (version 6.0) to generate an executable file (.exe). Do you know how I must configure the project settings in order to generate a gauge file instead (.gau)?I know the gauge files are DLLs, but I don't know how to configure MSVC for this. The files you attached are very helpful, it would be perfect if the worspace files (.dsw and .dsp) were also included...Many thanks !!Eric

Share this post


Link to post
Share on other sites

Please forget my previous question, I found the answer by myself...I have created a "Win32 Dynamic-Link Library" project, and I change the build settings to generate a file called .gau instead of .dll.It works perfect !!Thanks for your help.Eric

Share this post


Link to post
Share on other sites

The reason for not sending dsw and dsp was, that all paths in it are of course the ones on my machine, so you'll get more headaches with it that you get without.Arne Bartels

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