15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


How do I get the Document from CMyWinApp

Mackay -- gs94@dial.pipex.com
Sunday, May 19, 1996

Environment: Win 95/NT and VC++ 4.0

I am trying to impliment some idle time processing in my application, 
and I want to go through each of the documents and views performing 
clean up code.

How can I get at the documents from my CWinApp derived object?

Thanks,
-- 
***********************************************
** Colin Angus Mackay ** gs94@dial.pipex.com **
***********************************************
**              It's  Aye  Been!             **
***********************************************



Uma Shankar -- Uma_Shankar@countrywide.com
Sunday, May 19, 1996

Here is the code to get all the docs and views from the cwinapp class. 

Void YourApp::OnGetAllDocsAndViews() {
 POSITION pos = GetFirstDocTemplatePosition();
 while (pos!= NULL) {  // Iterate through all doc templates
  CDocTemplate* pDocTemplate = GetNextDocTemplate(pos);
  POSITON docPos = pDocTemplate->GetFirstDocPosition() ;
  while (docPos != NULL) {  // all Documents in a doc template
   pDoc = pDocTemplate->GetNextDoc(docPos);
   POSITION viewPos = pDoc->GetFirstViewPostion();
   while ( viewPos != NULL) {// All the views attached to the document
    CView* pView = pDoc->GetNextView(viewPos);
    //  here you can do your clean up
    //
   }
  }   
 }
}

cheers
shanky



Environment: Win 95/NT and VC++ 4.0

I am trying to impliment some idle time processing in my application, 
and I want to go through each of the documents and views performing 
clean up code.

How can I get at the documents from my CWinApp derived object?

Thanks,
-- 
***********************************************
** Colin Angus Mackay ** gs94@dial.pipex.com **
***********************************************
**              It's  Aye  Been!             **
***********************************************

 





| Вернуться в корень Архива |