文档/视图结构中的各个部分是如何联系到一起的[3]

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

本文简介:选择自 coordinate 的 blog

                //取第一个文档模板的指针

       cdoctemplate* ptemplate = (cdoctemplate*)m_templatelist.gethead();

       if (m_templatelist.getcount() > 1)

       {

              // 如果多于一个文档模板,出现对话框提示用户去选择

              cnewtypedlg dlg(&m_templatelist);

              int nid = dlg.domodal();

              if (nid == idok)

                     ptemplate = dlg.m_pselectedtemplate;

              else

                     return;     // none - cancel operation

       }

                ......

                //参数为null的时候opendocument file会新建一个文件

       ptemplate->opendocumentfile(null);

}

打开文件:

void cdocmanager::onfileopen()

{

       // 出现打开文件对话框

       cstring newname;

本文关键:文档/视图结构中的各个部分是如何联系到一起的
 

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

go top