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

  • 相关阅读:
    静态包含与动态包含
    REST风格下如何放行静态资源
    java迭代器
    es6之扩展运算符 三个点(...)
    关于Echarts配置项的工作记录
    vscode中vue代码格式化的相关配置
    v-loading
    git中Please enter a commit message to explain why this merge is necessary.
    slot
    slot的使用方法
  • 原文地址:https://www.cnblogs.com/chriszsy/p/13216133.html
Copyright © 2011-2022 走看看