您的位置:首页 > 其它

遍历应用程序的视图,文档,文档模板

2006-04-07 16:23 288 查看
void EnumAllView(CDocument*pDoc)
//遍历文档关联的视图
{
POSITION pos=pDoc->GetFirstViewPosition();
while (pos)
{
CView*pView=pDoc->GetNextView(pos);
/**/
}
}
void EnumAllDocment(CDocTemplate*pDocTemp)
//遍历文档模板对应的文档
{
POSITION pos=pDocTemp->GetFirstDocPosition();
while (pos)
{
CDocument*pDoc=pDocTemp->GetNextDoc(pos);
if (pDoc)
{
EnumAllView(pDoc);
}
}
}
void EnumAllDocTemp()
//遍历应用程序的文档模板
{
CDocManager*pDocMan=AfxGetApp()->m_pDocManager;
if (!pDocMan)
{
return ;
}
POSITION pos=pDocMan->GetFirstDocTemplatePosition();
while (pos)
{
CDocTemplate*pDocTemp=pDocMan->GetNextDocTemplate(pos);
if (pDocTemp)
{
EnumAllDocment(pDocTemp);
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: