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

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

本文简介:选择自 liukaven 的 blog

 

再接着进行createnewframe

cframewnd* cdoctemplate::createnewframe(cdocument* pdoc, cframewnd* pother)

{

     // create a frame wired to the specified document

     ccreatecontext context;           // 这个 createcontext 传递到 loadframe 中

     context.m_pcurrentframe = pother;         // 此例中 = null

     context.m_pcurrentdoc = pdoc;              // = 刚才创建的文档

     context.m_pnewviewclass = m_pviewclass;   // 显示此文档的视类的类型

     context.m_pnewdoctemplate = this;

 

     if (m_pframeclass == null)

          // 提示错误并返回

     // 利用 cruntimeclass 信息创建框架窗口对象,此例中为 cchildframe

     cframewnd* pframe = (cframewnd*)m_pframeclass->createobject();

 

     // 这里,我们又看到了 loadframe , 参考前面的 loadframe 吧

     // 在这里面,view 窗口也被产生出来。参考 trace 输出。

     pframe->loadframe(m_nidresource,

              ws_overlappedwindow | fws_addtotitle,   // default frame styles

              null, &context);

     return pframe;

}

 

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

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

go top