Compartir a través de


CDocument::GetNextView

Llame a esta función para recorrer las vistas de todo el documento.

virtual CView* GetNextView( 
   POSITION& rPosition  
) const;

Parámetros

  • rPosition
    Una referencia a un valor devuelto de POSICIÓN por una llamada anterior a GetNextView o miembro de GetFirstViewPosition funciona. este valor no debe ser NULL.

Valor devuelto

Un puntero a la vista identificada por rPosition.

Comentarios

La función devuelve la vista identificada por rPosition y establezca rPosition al valor de POSICIÓN de la vista siguiente en la lista. Si la vista recuperada es el último en la lista, después rPosition se establece en NULL.

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

CDocument Class

Gráfico de jerarquías

CDocument::AddView

CDocument::GetFirstViewPosition

CDocument::RemoveView

CDocument::UpdateAllViews