GetFirstViewPosition()
GetNextView()
配合使用可以获得Doc的所有View

解决方案 »

  1.   

    POSITION pos = GetFirstViewPosition();
    CView* pFirstView = GetNextView( pos );
    配合使用,循环可以获得Doc的所有View,那如何断定哪一个是我当前的doc对应的view? 
      

  2.   

    GetActiveView是CFrameWnd的成员函数,我试了一下,好像不行,我用的是msdn里的代码CMDIFrameWnd *pFrame = 
                 (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;// Get the active MDI child window.
    CMDIChildWnd *pChild = 
                 (CMDIChildWnd *) pFrame->GetActiveFrame();// or CMDIChildWnd *pChild = pFrame->MDIGetActive();// Get the active view attached to the active MDI child
    // window.
    CMyView *pView = (CMyView *) pChild->GetActiveView();
      

  3.   

    GetFirstViewPosition()
    GetNextView()
      

  4.   

    我已经解决了,就用GetFirstViewPosition(),GetNextView()
    谢了!
      

  5.   

    GetFirstViewPosition(),GetNextView()