CWinApp::m_pMainWnd

Remarks

Use this data member to store a pointer to your application's main window object. The Foundation class library will automatically terminate your application when the window referred to by m_pMainWnd is closed. If you don't store a valid CWnd pointer here, you must explicitly call the Windows function PostQuitMessage to terminate your application.