Hi
At this level of my C++ study I still have this question: which of the so many windows messages handled in the window's procedure is the recommended to create and load things in memory(load files, create controls, load strings into global variables, load images into global HBITAMPs, etc.)?
For now I use WM_CREATE but I am not sure
Thanks!
The WM_CREATE message can be considered as an object constructor if using OOP terminology. As you should by this time know, it is only called one time, just as the WM_DESTROY message is only called one time.
For a long time (15 years) I have used the WM_CREATE handler to allocate instance data, create child window controls, i.e., anything pertaining to an instance of a Window Class.
One time I heard from an experienced user (Steve Hutchenson - 'hutch' who runs the MASM Forum) that he had some problems with this in one instance,but I have to say I never have.
I much prefer creating all child window controls pertaining to an instantiation of a parent object within the WM_CREATE handler, rather than, for example, in WinMain(). This is just my personal opinion, but I think its much neater this way.