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

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

本文简介:选择自 liukaven 的 blog

其中 (ptarget->*mmf.pfn_cmd_v_v)() cwinapp::onfilenew() 产生调用,ptarget = cmditestapp类实例。调用进入如下:

 

void cwinapp::onfilenew()

{

     if (m_pdocmanager != null)

         m_pdocmanager->onfilenew();

}

 

进入进入到cdocmanager::onfilenew()

 

void cdocmanager::onfilenew()

{

     if (m_templatelist.isempty())

          // 提示没有模板并返回

     cdoctemplate* ptemplate = (cdoctemplate*)m_templatelist.gethead();    // 第一个

     if (m_templatelist.getcount() > 1)

          // 弹出一个对话框(很难看的)提示用户选择一个文档模板

 

     // 在这个例子里面,ptemplate 就是 cmditestapp::initinstance() 里面创建的那个模板

     ptemplate->opendocumentfile(null);

}

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

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

go top