CDocument::GetNextView

来源:互联网 发布:ipad视频格式转换软件 编辑:程序博客网 时间:2024/04/30 18:12

Call this function to iterate through all of the document's views.

virtual CView* GetNextView(
POSITION& rPosition
) const;

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.

A pointer to the view identified by rPosition.

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.

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