Export (0) Print
Expand All
Expand Minimize

CDocument::GetFirstViewPosition

Call this function to get the position of the first view in the list of views associated with the document.

virtual POSITION GetFirstViewPosition( ) const;

A POSITION value that can be used for iteration with the GetNextView member function.

//To get the first view in the list of views: 
// POSITION pos = GetFirstViewPosition(); 
// CView* pFirstView = GetNextView(pos); 
// 
// This example uses CDocument::GetFirstViewPosition 
// and GetNextView to repaint each view. 
// An easier way to accomplish the same result is to call 
// UpdateAllViews(NULL); 
void CExampleDoc::OnRepaintAllViews()
{
   POSITION pos = GetFirstViewPosition();
   while (pos != NULL)
   {
      CView* pView = GetNextView(pos);
      pView->UpdateWindow();
   }   
}

Header: afxwin.h

Show:
© 2014 Microsoft