Sdílet prostřednictvím


CDocument::GetNextView

Volání této funkce můžete iterovat všechny zobrazení dokumentu.

virtual CView* GetNextView( 
   POSITION& rPosition  
) const;

Parametry

  • rPosition
    Odkaz na pozice hodnotu vrácenou předchozí volání GetNextView nebo GetFirstViewPosition funkce členů.Tato hodnota nesmí být NULL.

Vrácená hodnota

Ukazatel na zobrazení označeny rPosition .

Poznámky

Vrátí funkce zobrazení označeny rPosition a poté nastaví rPosition na pozice hodnotu Další zobrazení v seznamu.Pokud je zobrazení načtených pak poslední v seznamu rPosition je nastavena na NULL.

Příklad

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

Požadavky

Záhlaví: afxwin.h

Viz také

Referenční dokumentace

Třída CDocument

Graf hierarchie

CDocument::AddView

CDocument::GetFirstViewPosition

CDocument::RemoveView

CDocument::UpdateAllViews