Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GAUGES.H vs FS9GAUGES.H

Featured Replies

  • Moderator

This is for Arne, but anyone who might know the answer may reply... :)Using MS Visual C++ .Net 2003 to compile the SDK.gau samples that MS provided...When using the "stock," GAUGES.H that comes with the SDK, I have zero problems compiling a perfect gauge, which of course should be expected, since it IS the one the MS developers use! :)However, when substituting Arne's enhanced fs9gauges.h file (as included in Dai's tutorial), I get the following Linker errors:...Visual Studio ProjectsGaugessampleSDK.Fuel_Selector.c(110) : error C2065: 'helpid' : undeclared identifier...Visual Studio ProjectsGaugessampleSDK.Fuel_Selector.c(110) : error C2099: initializer is not a constant...Visual Studio ProjectsGaugessampleSDK.Fuel_Selector.c(110) : warning C4047: 'initializing' : 'ID' differs in levels of indirection from 'BOOL (__stdcall *)(PPIXPOINT,FLAGS32)'...Visual Studio ProjectsGaugessampleSDK.FlightMap.c(69) : error C2099: initializer is not a constant...Visual Studio ProjectsGaugessampleSDK.FlightMap.c(69) : warning C4047: 'initializing' : 'ID' differs in levels of indirection from 'MOUSE_FUNCTION (__stdcall *)'...Visual Studio ProjectsGaugessampleSDK.FlightMap.c(152) : warning C4018: ':)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Moderator

Ah ha! I found the problem!In Dai's version are the following two #define statements:#define MOUSE_CHILD_EVENT( x, y, w, h, cursor, mouse_flags, event_id ) {MOUSE_RECT_CHILD, {x, y, w, h}, cursor, helpid, mouse_flags, event_id, NULL, NULL},#define MOUSE_CHILD_FUNCT( x, y, w, h, cursor, mouse_flags, function ) {MOUSE_RECT_CHILD, {x, y, w, h}, cursor, helpid, mouse_flags, 0, function, NULL},Those are apparently incorrect, as Arne's version is as follows:#define MOUSE_CHILD_EVENT( x, y, w, h, cursor, mouse_flags, event_id ) {MOUSE_RECT_CHILD, {x, y, w, h}, cursor, HELP_NONE, mouse_flags, event_id, NULL, NULL},#define MOUSE_CHILD_FUNCT( x, y, w, h, cursor, mouse_flags, function ) {MOUSE_RECT_CHILD, {x, y, w, h}, cursor, HELP_NONE, mouse_flags, 0, function, NULL},The only difference is HELP_NONE vs helpid...After modifying Dai's version, substituting "HELP_NONE" for "helpid," the sample gauges now compile with only the same "warning" as with Arne's version...

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Are you sure the fs9gauges.h you use, is the latest from the sd2gau series? It should be the same as the "mine" because it is more or less the same. I think Dai had a fs9gauges.h modified from the 2k2 SDK just after FS9 came into market, but the fs9gauges.h in the latest sd2gau17 issue is a modified version of the SDKs gauges.h.Arne Bartels

Oops, how could this have happened? The second form is correct. Or if you want you can modify the child macros to hold their own helpid, by adding helpid to the left of the macros. With older Fs versions this worked, for FS9 I haven't tested.Arn Bartels

If you do mod the macro definition so you can have helpid's, then be sure that you know you can use HELP_NONE which evals to (NULL*)0, and not just zero (0), as there are times when you will not want to define a helpid.The benefits of doing the mod? Well, all it buys you is not have to use MOUSE_PARENT_BEGIN to define a new "area", and let's you use the one line of code. So, it's cleaner.

Actually, I think you sent me your fs9gauges.h, and it should have been part of the "test" package I forwarded to Bill.Bill, if you didn't get it, and you want it, let me know, and I'll email you another copy.

  • Author
  • Moderator

>Are you sure the fs9gauges.h you use, is the latest from the>sd2gau series? It should be the same as the "mine" because it>is more or less the same. I think Dai had a fs9gauges.h>modified from the 2k2 SDK just after FS9 came into market, but>the fs9gauges.h in the latest sd2gau17 issue is a modified>version of the SDKs gauges.h.>Arne BartelsHere are the comments from the top of Dai's fs9gauges.h file:// gauges.h// Copyright © 2004 Microsoft Corporation. All rights reserved.////Modified by Dai Griffiths, Dragonflight Design, St.Patrick's Day 2004// - Spelling errors corrected// - Mouse flags corrected so that the helpid can be inserted in the main string// - Full backwards compilation compatibility with existing FS2K2/FS2K gauges added// - All Arne Bartels' original hard work on correcting the previous two SDK gauges.h files added// - All Arne's excellent shorthand conversion macros added// - Hopefully all previous third-party gauges based on fs2k2gauges.h will now compileI don't believe that there is a later version than this, since it came in the sd2gau17 issue of the tutorial.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Moderator

>Actually, I think you sent me your fs9gauges.h, and it should>have been part of the "test" package I forwarded to Bill.>>Bill, if you didn't get it, and you want it, let me know, and>I'll email you another copy.Er, yes... I do have Arne's latest version ('cause it was in the "test" package you sent), otherwise how would I have been able to make the comparison and find the 'error' in Dai's version? :)Since the two versions are now identical, I see no burning need to have multiple 'gauge'.h files cluttering up the inc folder. Arne's latest seems to work just fine, so I'll stick with it... :)I will however, keep the "stock" MS gauges.h file on hand for reference...

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.