Initializing CWinThread member
-
why is it said not to initialize in cwinthread constructor but in InitInstance()..
-
why is it said not to initialize in cwinthread constructor but in InitInstance()..
Where is this "said?" Seeing it in context might help us to better understand what is meant.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
why is it said not to initialize in cwinthread constructor but in InitInstance()..
The constructor runs on whatever thread creates the
CWinThread
object (at the point the object is created).InitInstance
runs on the thread itself once it has been started. Typically there isn't much difference between the two, but things like Thread Local Storage will be affected. MFC uses a fair amount of Thread Local Storage internally. Stability. What an interesting concept. -- Chris Maunder