Enumerate documents in MDI applications

To enumerate all open documents in MDI (Multiple Document Interface) MFC applications we can do the following: Use CWinApp::GetFirstDocTemplatePosition and CWinApp::GetNextDocTemplate to get application document templates. For each document template, use CDocTemplate::GetFirstDocPosition and CDocTemplate::GetNextDoc to get contained documents. Getting documents list // MyMDIApp.h // … typedef CTypedPtrList<CObList, CDocument*> DocsPtrList; // … class CMyMDIApp : public … Read more