//取第一个文档模板的指针
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;