Worker thread and AfxGetMainWnd
Posted on 2004-09-19
I have the following piece of code:
CMainFrame *pFrm = (CMainFrame *)AfxGetMainWnd();
It works fine from the main thread of the application. For some reason, I cannot call this function from a worker thread.
I have heard there is a problem when AfxGetMainWnd is called from a worker thread. Is this correct, and if so, why and what kind of problems?