• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

VS2012 c++

Messages
70
Country
unitedkingdom
Good evening folks

I am moving on to creating gauges for my shorts 360. I wish to use c++ for creating my gauges this is a personal choice as I am comfortable in programming in C++ plus I spent four years with the language through uni.

my first problem is when I add an existing item to create my voltmeter it is not linked (see image link below)
http://prntscr.com/ghjpfz

Editing other files has gone without problems
http://prntscr.com/ghjprq

have I missed something obvious?

thank you in advance

Daniel
 
Care to share?
Just to avoid that somebody with a similar problem is left stranded.
 
yeah of course :)

When adding a new class file I will use my own as an example, when creating your new file "shorts.voltmeter.cpp" usually the header file stuff is crying out with errors, (see cod ebelow to see which part of the header code I mean to avoid confusion this is not your gauges .h file.)

Code:
//    Set up gauge header
char dcvolts_gauge_name[]        = GAUGE_NAME;
extern PELEMENT_HEADER        dcvolts_list;
extern MOUSERECT            dcvolts_mouse_rect[];
GAUGE_CALLBACK                dcvolts_update;

GAUGE_HEADER_FS700( GAUGE_W, dcvolts_gauge_name, &dcvolts_list,    dcvolts_mouse_rect, dcvolts_update, 0, 0, 0);

You have your main class file (mine is simply shorts.cpp) this lists all the defines you have for your gauges such as its name etc. The most important part of this code is when you include the file you just created. for example the shorts.voltmeter.cpp. See code below.

Code:
/////////////////////////////////////////////////////////////////////////////
// Voltmeter
/////////////////////////////////////////////////////////////////////////////
#define        GAUGE_NAME            "Voltmeter"
#define        GAUGEHDR_VAR_NAME    gaugehdr_voltmeter
#define        GAUGE_W                100

#include "short.Voltmeter.cpp" //<------ IMPORTANT :D

Funny thing is when typing this out, i just realized it is the telling the IDE you want to include a class lol, Just different from what i was taught in uni as we did it all at the top of the class :banghead:

anyhoo got to go do a couple more lines of code :)

Daniel
 
Back
Top