Hello,

I created two split views like this:

BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext )
{
CFrameWnd::OnCreateClient(lpcs, pContext);

if (!m_wndSplitter.CreateStatic (this, 2, 1) ||
!m_wndSplitter.CreateView (0, 0, RUNTIME_CLASS (CFirstView),
CSize (0, 256), pContext) ||
!m_wndSplitter.CreateView (1, 0, RUNTIME_CLASS (CSecondView),
CSize (0, 0), pContext))
return FALSE;

return TRUE;
}

Then I added a menu item and get it handled:

void CMainFrame::OnAlohaHowAreYou()
{
m_pDoc = (CAlohaDoc*)GetActiveDocument();

m_pDoc->SayHowAreYou();
}

When I step into CMainFrame::OnAlohaHowAreYou(), I found m_pDoc is NULL. If I remove the split views and make CMainFrame::OnCreateClient() like below, then there is no problem.

BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext )
{
CFrameWnd::OnCreateClient(lpcs, pContext);

return TRUE;
}

What could be wrong?

Thanks,
Brian