Sign in to follow this  
Guest zip

MOUSE_CHILD_FUNCT correction

Recommended Posts

Since with this MACRO:

#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},

(which mysteriously omits helpid in the formal parameters)and this code:

MOUSE_BEGIN( switch_strobe_mouse_rect, HELPID_GAUGE_LIGHT_SWITCH_STROBE, 0, 0 )	MOUSE_CHILD_FUNCT( 0, 0, 43, 73, CURSOR_UPARROW, MOUSE_LEFTSINGLE, switch_strobe_mcb)MOUSE_END

You get this error:

B206B3.Switch_Strobe.c(62) : error C2065: 'helpid' : undeclared identifier

I'm thinking this redefinition of the MACRO fixes it:

#define	MOUSE_CHILD_FUNCT(x, y, w, h, cursor, mouse_flags, function, helpid)	{MOUSE_RECT_CHILD, {x, y, w, h}, cursor, helpid, mouse_flags, 0, function, NULL},

by then using this code:

MOUSE_BEGIN( switch_strobe_mouse_rect, HELPID_GAUGE_LIGHT_SWITCH_STROBE, 0, 0 )	MOUSE_CHILD_FUNCT( 0, 0, 43, 73, CURSOR_UPARROW, MOUSE_LEFTSINGLE, switch_strobe_mcb, HELPID_GAUGE_LIGHT_SWITCH_STROBE)MOUSE_END

Comments?

Share this post


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

The original version of that macro works for me without any problems.#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},

Share this post


Link to post
Share on other sites

I use Visual Studio .NET 2003 btw. May be it's a compiler thing.

Share this post


Link to post
Share on other sites

Try this:MOUSE_BEGIN(switch_strobe_mouse_rect,HELP_NONE, 0, 0 ) MOUSE_PARENT_BEGIN(0,0,43,73,HELPID_GAUGE_LIGHT_SWITCH_STROBE) MOUSE_CHILD_FUNCT(0,0,43,73,CURSOR_UPARROW, MOUSE_LEFTSINGLE, switch_strobe_mcb) MOUSE_PARENT_ENDMOUSE_END

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