CDocument::GetNextView
Visual Studio .NET 2003
Call this function to iterate through all of the document's views.
virtual CView* GetNextView( POSITION& rPosition ) const;
Parameters
- rPosition
- A reference to a POSITION value returned by a previous call to the GetNextView or GetFirstViewPosition member functions. This value must not be NULL.
Return Value
A pointer to the view identified by rPosition.
Remarks
The function returns the view identified by rPosition and then sets rPosition to the POSITION value of the next view in the list. If the retrieved view is the last in the list, then rPosition is set to NULL.
Example
// This example uses CDocument::GetFirstViewPosition
// and GetNextView to repaint each view.
void CMyDoc::OnRepaintAllViews()
{
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = GetNextView(pos);
pView->UpdateWindow();
}
}
// An easier way to accomplish the same result is to call
// UpdateAllViews(NULL);
See Also
CDocument Overview | Class Members | Hierarchy Chart | CDocument::AddView | CDocument::GetFirstViewPosition | CDocument::RemoveView | CDocument::UpdateAllViews