What m_pMainWnd pointer points to by default?
<p>I'm currently studying MFC library and I noticed that in default generated application by Visual Studio there is no assignment to m_pMainWnd pointer. So my question is what that pointer points to? I also did an example from a tutorial I found recently and there was a dialog class object created in InitInstance function and it's address was assigned to m_pMainWnd pointer:</p>

<pre><code>virtual BOOL InitInstance()
{
    CWinApp::InitInstance();
    GAME_FORM dlg; //dialog object
    m_pMainWnd = &amp;dlg; //dialog object set as main window
    INT_PTR nResponse = dlg.DoModal();
} 
</code></pre>

<p>When MFC application is created by application wizard there are only two lines in entire solution where m_pMainWnd is used, and it's not an asiggement. So what that pointer points to?</p>

<pre><code>BOOL CMFCTestyApp::InitInstance()
{
(...)
// The one and only window has been initialized, so show and update it
m_pMainWnd-&gt;ShowWindow(SW_SHOW);
m_pMainWnd-&gt;UpdateWindow();
(...)
}
</code></pre>