Call this function to iterate through all of the document's views.
virtual CView* GetNextView(
POSITION& rPosition
) const;
Remarks
Example
Visual C++
//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();
}
}
本文介绍了一个用于遍历文档中所有视图的函数GetNextView,该函数通过传递POSITION值来获取下一个视图,并更新该值以便继续遍历。示例展示了如何使用此函数更新文档中的所有视图。
4845

被折叠的 条评论
为什么被折叠?



