zoukankan      html  css  js  c++  java
  • MFC MDI 遍历打开的所有文档

    (1)在MFC中的多文档工程中得到当前文档
    CMDIFrameWnd  *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; 
    CMDIChildWnd  *pChild = (CMDIChildWnd   *)pFrame->GetActiveFrame();   
    CView   *pV = (CView*)pChild->GetActiveView();
    CDocument* pDoc = pV->GetDocument();
    (2)在MFC中的多文档工程中遍历所有文档
    POSITION pos = theApp.GetFirstDocTemplatePosition();
    while (pos != NULL)
    {
     CDocTemplate *p = theApp.GetNextDocTemplate(pos);
     POSITION posdoc = p->GetFirstDocPosition();
     while (posdoc != NULL)
     {
      CDocument* pDoc = p->GetNextDoc(posdoc);
           if (pDoc != NULL)
          {
               POSITION posview = pDoc->GetFirstViewPosition();
              if (posview != NULL)
              {
                  CView* pV = pDoc->GetNextView(posview);
              }
          }
       }
    }
    (3)关闭某个文档

          pDoc->OnCloseDocument();

  • 相关阅读:
    iperf简单说明
    计算后图像大小参数计算
    ipywidgets安装报错
    Cannot uninstall [pacakage]. It is a distutils installed project
    torch
    es-centos7安装注意细节
    jupyter 指定特定的环境
    未来方向
    深度学习过拟合处理
    归一化
  • 原文地址:https://www.cnblogs.com/johnpher/p/2570697.html
Copyright © 2011-2022 走看看