CObList lstFrames;
CDocManager *pDocManager = AfxGetApp()-> m_pDocManager;
POSITION pos = pDocManager-> GetFirstDocTemplatePosition();while(pos)
{
CDocTemplate* pTemplate = (CDocTemplate*)pDocManager-> GetNextDocTemplate(pos);
{
POSITION pos = pTemplate-> GetFirstDocPosition();
while (pos)
{
CDocument* pDoc = pTemplate-> GetNextDoc(pos);
{
POSITION pos = pDoc-> GetFirstViewPosition();
while(pos)
{
CView *pView = pDoc-> GetNextView(pos);
CFrameWnd *pFrame = pView-> GetParentFrame();
if(lstFrames.Find(pFrame) == NULL)
{
lstFrames.AddTail(pFrame);
}
}
}
}
}
}