在MDIFrame中遍历所有的doc和view

 //get first doc template

POSITION posTemp = theApp.GetFirstDocTemplatePosition();

while(posTemp)

{ // traversal doc template

  CDocTemplate *pDocTemp = theApp.GetNextDocTemplate(posTemp);

  POSITION posDoc = pDocTemp->GetFirstDocPosition();

  while(posDoc)

  { // traversal document

    CDocument *pDoc = pDocTemp->GetNextDoc(posDoc);

    // pDoc represent every document …

    POSITION posView=pDoc->GetFirstViewPosition();

    while(posView)

    { // get first view

      CView2D *pView=(CView2D*)(pDoc->GetNextView(posView));

      // pView represent every view …

    }

  }

}

posted on 2012-12-11 10:53  生不如死  阅读(776)  评论(0编辑  收藏  举报

导航