CDocument::GetFirstViewPosition

调用此函数获取第一个视图的位置在视图中列出与文档。

virtual POSITION GetFirstViewPosition( ) const;

返回值

可用于 GetNextView 成员函数的迭代使用的 POSITION 值。

示例

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

要求

Header: afxwin.h

请参见

参考

CDocument Class

层次结构图

CDocument::GetNextView