在MFC中动态分割窗口,但窗口没有像预期的一样分成4个小窗口,只是在右边和下边多了拖动条,希望高手们帮忙解惑,万分感谢。
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
    if(!m_wndSplitter.Create(this,2,2,CSize(10,10),pContext))
return FALSE;    return TRUE;
}

解决方案 »

  1.   

    也没有看到你调用CSplitterWnd::CreateView()BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
    {
       m_bSplitterCreated = m_wndSplitter.CreateStatic(this, 1, 2);
       // CMyView and CMyOtherView are user-defined views derived from CView
       m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMyView), CSize(0, 0), 
          pContext);
       m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CMyOtherView), CSize(0, 0), 
          pContext);   return (m_bSplitterCreated);
    }
      

  2.   

    void CXXX::OnInitialUpdate() 
    {
    CFormView::OnInitialUpdate();

    // TODO: Add your specialized code here and/or call the base class
        m_nMapMode = -1; //去掉滚动条
    }
    我是这么处理的
      

  3.   

    m_wndSplitter.SetColumnInfo(0,200,0);
    if (!m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CChildTreeView),CSize(200,400),pContext))
    {
    TRACE(_T("Failed to create view in first pane"));
    return FALSE;
    } if (!m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CChildTreeView),CSize(200,400),pContext))
    {
    TRACE(_T("Failed to create view in first pane"));
    return FALSE;
    }