Jump to content
Sign in to follow this  
n4gix

GAUGES.H vs FS9GAUGES.H

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Guest bartels

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

Share this post


Link to post
Share on other sites
Guest 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

Share this post


Link to post
Share on other sites
Guest HC001ST - Stick

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.

Share this post


Link to post
Share on other sites
Guest HC001ST - Stick

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.

Share this post


Link to post
Share on other sites

>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

Share this post


Link to post
Share on other sites

>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

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