PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: James Fuller on February 03, 2010, 08:01:39 PM

Title: static vars and custom callback
Post by: James Fuller on February 03, 2010, 08:01:39 PM
I am porting an app that uses several static variables in the Window Callback Function.
Some of the var's are set in a FF3 Custom callback but also need to be accessed by a normal button click. It appears the only recourse is GLOBAL but that is not an option. Am I SOL???

James
Title: Re: static vars and custom callback
Post by: Paul Squires on February 03, 2010, 08:34:27 PM
Not really out of luck - you can deal with every message in the CUSTOM handler (except WM_CREATE) just like you do in a regular WndProc procedure. Granted, if you use this approach then you can not use the separate message handlers. If you use the separate message handlers then you could store the variables as properties (SetProp, GetProp) of the Form or Control, but using that approach you may as well stick with using globals.

Title: Re: static vars and custom callback
Post by: James Fuller on February 04, 2010, 06:38:14 AM
Aha..
Moving WM_COMMAND to the CUSTOM function worked fine. Thanks

James