我们可以这样认为,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; } |