Why you put a function to get the hwnd of a control instead of putting his hwnd on a global variable when creating it (Visual mode)?
Posted on 2005-11-12 11:12:42 by Eduardo Schardong
Hi Eduardo,

For a good style of programming you should not abuse of global variables. In fact, an application should have as litlle global variables as possible. Global variables may cause problems as they can be changed in any part of the code.

Regards,

Ramon
Posted on 2005-11-13 07:25:53 by rsala
rsala,
I understand all problems of global variables, the wrong use of them by the programer, etc. But a tool is usefull if it help us not if it limit us, if you put an option to save all the handles in global variables it will help lots of programers, if someone don't use them correctly it isn't your problem,
Is a little strange you don't put global variables to save the handles and the users put a GetWindowItem for each control on the WM_CREATE to save the globals...
Posted on 2005-11-13 08:31:19 by Eduardo Schardong
Eduardo,

Even though I think there is no limitation, as you can have the handles and store them in global variables if you like, I'll study the possibility of adding the feature you propose. Anyway I think it's better to let the programmer to decide whether he wants global variables or not.

Ramon
Posted on 2005-11-13 16:18:21 by rsala