视图分割失败的原因

//MainFrm.h
CSplitterWnd      m_SplitterFirst;
CSplitterWnd   m_SplitterSecond;


//MainFrm.cpp
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
 CRect r;
 GetWindowRect(r);
 short  wide = r.right - r.left;
 short height = r.bottom - r.top;

 m_SplitterFirst.CreateStatic(this,1,2);

 m_SplitterFirst.CreateView(0,0, RUNTIME_CLASS( CControlView), CSize(wide*0.14, height), pContext);
 m_SplitterSecond.CreateStatic(&m_SplitterFirst, 2, 1, WS_CHILD | WS_VISIBLE |WS_BORDER, m_SplitterFirst.IdFromRowCol(0, 1));
        m_SplitterSecond.CreateView(0,0,RUNTIME_CLASS(CLampSystemView), CSize(400,400), pContext);

 m_SplitterSecond.CreateView(1, 0, RUNTIME_CLASS( CControlView) ,CSize(wide, height*0.40), pContext);
 m_SplitterSecond.SetRowInfo(0, r.Height()*0.60, 50);
 //return TRUE;
 return CFrameWnd::OnCreateClient(lpcs, pContext);
}

死活视图分割就是出现不了,后来把返回值改成return TRUE; 视图分割成功。

 

你可能感兴趣的:(视图)