static vars and custom callback

Started by James Fuller, February 03, 2010, 08:01:39 PM

Previous topic - Next topic

James Fuller

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

Paul Squires

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.

Paul Squires
PlanetSquires Software

James Fuller

Aha..
Moving WM_COMMAND to the CUSTOM function worked fine. Thanks

James