zoukankan      html  css  js  c++  java
  • MultiTop CHRIS

    // SAMPLE: make a spot to store the template
     // we're using so we can access it later

    CMultiTopApp 中加入成员变量

    CMultiDocTemplate* m_pDocTemplate;

    // CMultiTopApp commands

    // SAMPLE: This function handles the "New Frame Window" menu

    void CMultiTopApp::OnFileMakeNewFrame()
    {
     ASSERT(m_pDocTemplate != NULL);

     CDocument* pDoc = NULL;
     CFrameWnd* pFrame = NULL;

     pDoc = m_pDocTemplate->CreateNewDocument();
     if (pDoc != NULL)
     {
      pFrame = m_pDocTemplate->CreateNewFrame(pDoc, NULL);
      if (pFrame != NULL)
      {
       m_pDocTemplate->SetDefaultTitle(pDoc);
       if (!pDoc->OnNewDocument())
       {
        pFrame->DestroyWindow();
        pFrame = NULL;
       }
       else
        m_pDocTemplate->InitialUpdateFrame(pFrame, pDoc, TRUE);
      }
      else
       delete pDoc;
     }

     if (pFrame == NULL || pDoc == NULL)
      AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);
    }

    BOOL CMultiTopApp::InitInstance()

    加入// Enable drag/drop open
     m_pMainWnd->DragAcceptFiles();

    // CMainFrame message handlers

    // SAMPLE: if we load a frame and there's no main window
    // yet in the app, we're loading the main frame right now and
    // that window should become the main window of the application.

    BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle,
      CWnd* pParentWnd, CCreateContext* pContext)
    {
     // base class does the real work

     if (!CFrameWnd::LoadFrame(nIDResource, dwDefaultStyle,
      pParentWnd, pContext))
     {
      return FALSE;
     }

     // test for main-ness

     CWinApp* pApp = AfxGetApp();
     if (pApp->m_pMainWnd == NULL)
      pApp->m_pMainWnd = this;

     return TRUE;
    }

  • 相关阅读:
    ABP dynamic API
    SQL语句 还原未知逻辑名称数据库
    SQL 还原数据库
    使用开源项目集锦
    webp性能测评
    js通过继承实现私有函数
    js组合继承和寄生组合式继承比较
    JS中循环绑定遇到的问题及解决方法
    JS学习之事件流
    OpenGL利用模板测试实现不规则裁剪
  • 原文地址:https://www.cnblogs.com/chriszsy/p/13216133.html
Copyright © 2011-2022 走看看