Jump to content
Sign in to follow this  
Guest zip

MOUSE_CHILD_FUNCT correction

Recommended Posts

Guest HC001ST - Stick

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
Guest HartmannH

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
Guest HartmannH

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

Share this post


Link to post
Share on other sites
Guest zip

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  

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