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

  • 相关阅读:
    前端开发者进阶之ECMAScript新特性--Object.create
    JS事件:target与currentTarget区别
    30分钟掌握ES6/ES2015核心内容
    百度跨域搜索demo
    <a>标签的SEO优化细节
    jQuery之异步Ajax请求使用
    小tips: zoom和transform:scale的区别
    JSP页面静态化总结之一使用URLRewrite实现url地址伪静态化
    web前端安全机制问题全解析
    【转】Asp.net MVC Comet推送
  • 原文地址:https://www.cnblogs.com/chriszsy/p/13216133.html
Copyright © 2011-2022 走看看