Share via


CDocument::GetFirstViewPosition

Llame a esta función para obtener la posición de la primera vista en la lista de vistas asociado al documento.

virtual POSITION GetFirstViewPosition( ) const;

Valor devuelto

Un valor de POSICIÓN que se puede utilizar para la iteración mediante la función miembro de GetNextView .

Ejemplo

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

Requisitos

encabezado: afxwin.h

Vea también

Referencia

Clase de CDocument

Gráfico de jerarquía

CDocument::GetNextView