温故而知新,学习MFC框架如何创建的过程[8]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 liukaven 的 blog

 

我们可以这样认为,cdoctemplate用于描述frame-view-doc的关系。当然它还有一大堆别的属性,我们暂时先忽略。

 

一会还会看到cdoctemplate的创建文档、框架、视的过程,放在processshellcommand中研究。

 

 

研究loadframe

 

让我们继续研究cframewnd::loadframe是怎么运作的。使用的方法是跟踪进入。。。

bool cmdiframewnd::loadframe(uint nidresource, dword dwdefaultstyle,

     cwnd* pparentwnd, ccreatecontext* pcontext)

{

     // 调用基类 cframewnd 的 loadframe, pcontext 在创建主窗口时 = null

     //   pparentwnd = null

     if (!cframewnd::loadframe(nidresource, dwdefaultstyle,

       pparentwnd, pcontext))

         return false;

 

     // save menu to use when no active mdi child window is present

     assert(m_hwnd != null);

     // 主窗口带有菜单,所以。。。

     m_hmenudefault = ::getmenu(m_hwnd);

     if (m_hmenudefault == null)

         trace(traceappmsg, 0, "warning: cmdiframewnd without a default menu.\n");

     return true;

}

本文关键:温故而知新,学习MFC框架如何创建的过程
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top