// TODO: 在此添加控件通知处理程序代码
POSITION curTemplatePos=AfxGetApp()->GetFirstDocTemplatePosition();
while(curTemplatePos != NULL)
{
CDocTemplate* curTemplate =
AfxGetApp()->GetNextDocTemplate(curTemplatePos);
CString str;
curTemplate->GetDocString(str, CDocTemplate::docName);
if(str == _T("MFC33"))
{
//curTemplate->OpenDocumentFile(NULL);
POSITION ps = curTemplate->GetFirstDocPosition();
if(ps)
{
CDocument* pDoc = curTemplate->GetNextDoc(ps);
ps = pDoc->GetFirstViewPosition();
if (ps)
{
CView* pView = pDoc->GetNextView(ps);
pView->GetParentFrame()->ActivateFrame(SW_SHOWMAXIMIZED);
}
}
else
{
curTemplate->OpenDocumentFile(NULL);
}
return;
}
}
mfc 打开指定文档
最新推荐文章于 2021-01-17 17:00:45 发布