我建立了一个sdi程序,将mianframe的客户区用splitter分成2列,每一列的pane都是FrameWnd,每个FrameWnd内都有对应的view,请问如何得到这些view,我试过FrameWnd->getactiveview(),结果返回空值.

解决方案 »

  1.   

    你可以通过文档模板的遍历视图试试,具体的可以看看msdn。
      

  2.   

    m_splitter.GetPane();//能够直接返回啊!
      

  3.   

    CMainFrame  *m_mainframe = (CMainFrame*)AfxGetMainWnd();
    CIHISSERVERView *pview = (CIHISSERVERView*)m_mainframe -> GetActiveView();
      

  4.   

    CWnd* pWnd=this->m_wndSplitter.GetDlgItem(this->m_wndSplitter.IdFromRowCol(0,0));
    CSplitView* pView=(CSplitView*)pWnd;
      

  5.   

    壮志胸心的正确呀
    this->m_wndSplitter.GetPane(0,0)->GetDC()->TextOut(0,0,"aa");
    应该有反应
      

  6.   


    CSplitterWnd m_wndSplitter;//必须为public
    CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();
    CMyView *pView = (CMyView *)(pFrame ->m_wndSplitter.GetPane(0,0));
    pView就可以乐吧
      

  7.   

    各位可能是我没表达清楚,我在splitter的pane中放入的是framewnd,framewnd中有一个newview,在创建framewnd的时候在framewnd::oncreate()中,通过 CCreateContext* pContext->m_pNewViewClass=RUNTIME_CLASS(newview)指向新的view实现的,现在在另一类中需要引用该newview,请问怎么办