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);
    }

  • 相关阅读:
    视图
    Mysql事务
    子查询
    Mysql连表查询
    Mysql增删改查
    Mysql数据类型
    EntityFramwork 查询
    Git
    EntityFramework走马观花之CRUD(下)
    EntityFramework走马观花之CRUD(中)
  • 原文地址:https://www.cnblogs.com/cutepig/p/1728701.html
Copyright © 2011-2022 走看看