Partager via


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;

Return Value

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

Example

//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();
   }   
}

Requirements

Header: afxwin.h

See Also

Concepts

CDocument Class

CDocument Members

Hierarchy Chart

CDocument::GetNextView