standard mfc wizard m_pMainWnd?

Started by
1 comment, last by GekkoCube 20 years, 7 months ago
in a standard mfc app that the appwzard generates, where is m_pMainWnd, declared? I did a "search in files" for this, and it only shows three occurances, (none plcaed by me and other 2 placed there by default). I just dont understand that this (which appears to be a member pointer, is not anywhere i would logically expect to find. in fact, like i just mentioned, its nowhere to be found!
Advertisement
well, you could use
AfxGetApp()->m_pMainWnd

or

theApp->m_pMainWnd if you include theApp as an extern in the file you wish to use it in.

Cheers
quote:Original post by NatasDM
well, you could use
AfxGetApp()->m_pMainWnd

or

theApp->m_pMainWnd if you include theApp as an extern in the file you wish to use it in.

Or
AfxGetMainWnd()

m_pMainWnd is a member of CWinThread. CWinApp is a subclass of CWinThread, and your applicaton class probably inherits from CWinApp.

This topic is closed to new replies.

Advertisement