zoukankan      html  css  js  c++  java
  • Create different SDI windows

    Create different SDI windows
    1. BOOL CtestMDIApp::InitInstance()

    CMultiDocTemplate* pDocTemplate;
     pDocTemplate = new CMultiDocTemplate(IDR_testMDITYPE,
      RUNTIME_CLASS(CtestMDIDoc),
      RUNTIME_CLASS(CChildFrame), // custom MDI child frame
      RUNTIME_CLASS(CtestMDIView));
     AddDocTemplate(pDocTemplate);

     pDocTemplate = new CMultiDocTemplate(IDR_testMDITYPE, //IDR_View1TYPE,
      RUNTIME_CLASS(CtestMDIDoc),
      RUNTIME_CLASS(CChildFrame), // custom MDI child frame
      RUNTIME_CLASS(CView1));
     AddDocTemplate(pDocTemplate);

    2. void CMainFrame::OnHelp1()

    static
    void OnFileNew(CDocManager* mgr, UINT nIdx)
    {
     POSITION pos = mgr->GetFirstDocTemplatePosition();
     CDocTemplate* pTemplate = 0;
     for (UINT i=0; i<=nIdx && pos != NULL; i++)
     {
      pTemplate = mgr->GetNextDocTemplate(pos);
      ASSERT_KINDOF(CDocTemplate, pTemplate);
     }

     if(!pTemplate)
      return;

     ASSERT(pTemplate != NULL);
     ASSERT_KINDOF(CDocTemplate, pTemplate);

     pTemplate->OpenDocumentFile(NULL);
      // if returns NULL, the user has already been alerted
    }

    // CMainFrame message handlers


    void CMainFrame::OnHelp1()
    {
     OnFileNew(AfxGetApp()->m_pDocManager, 0);
    }

  • 相关阅读:
    宋元
    隋唐
    中国历史上三次大分裂时期
    三国
    PCL点云 no override found for 'vtkActor'.
    PCL 点云欧式聚类
    PCL区域生长分割
    OPENCV 求轮廓方向
    pcl点云的创建、访问与转换
    PCL 圆柱模型和平面模型的分割
  • 原文地址:https://www.cnblogs.com/cutepig/p/1728701.html
Copyright © 2011-2022 走看看