...
CSplitterWnd m_wndSplitter;
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CUpperView), CSize(150,0), pContext);
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CLowerView), CSize(0,0), pContext);
...如何获得上面两个视图的指针呢?谢谢!

解决方案 »

  1.   

    遍历~
            CView* pView;
    POSITION pos = GetFirstViewPosition(); while(pos!=NULL)
    {
    pView = GetNextView(pos);
    if(!pView->IsKindOf(pClass))
    break;
    } if(!pView->IsKindOf(pClass))
    {
    AfxMessageBox("Connt Locate the View");
    return NULL;
    }
      

  2.   

    GetNextView是文档类的函数吧,要先得到文档类的指针才行,那么如何获得文档类的指针呢?
      

  3.   

    哦,知道了,用CView::GetDocument(). ft多谢各位!
      

  4.   

    还是根据m_wndSplitter 来取你各个view吧。:)
    CMyEditView *pEditView=(CMyEditView*)m_wndSplitter.GetPane(0,0);