遍历应用程序的视图,文档,文档模板
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);
}
}
}
//遍历文档关联的视图
{
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);
}
}
}
相关文章推荐
- 遍历文档模板、文档和视图
- MFC多文档应用程序同时显示两个视图
- 猎豹MFC2(不需要全部搞懂,把重要的地方搞懂就可以了)文档视图体系结构CDoc CView对象 向导模板 自动类型TCHAR LPTSTR……
- 深入浅出MFC“文档/视图”架构(2)――文档模板
- 深入浅出MFC文档/视图架构之文档模板(1)
- C++--在单文档的应用程序增加多个视图
- 文档视图应用程序实例
- 文档、视图、框架窗口、文档模板之间的相互关系
- C++--在单文档的应用程序增加多个视图
- MFC 模板、文档、视图、框架的关系
- 单文档视图应用程序
- 多模板文档视图结构的应用
- 深入浅出MFC文档/视图架构之文档模板(3)
- C++--在单文档的应用程序增加多个视图
- 深入浅出MFC文档/视图架构之文档模板
- SDI或MDI中获得某个文档模板的视图
- MFC 应用、模板、框架、文档、视图 的关系
- MFC中文档视图框架和文档模板之间的关系
- MFC文档、视图、框架窗口、文档模板之间的相互关系
- 文档、视图、框架窗口、文档模板之间的相互关系【转】