共用方式為


CDocument::GetFirstViewPosition

呼叫此函式來取得第一個檢視的位置在檢視清單與文件相關聯的。

virtual POSITION GetFirstViewPosition( ) const;

傳回值

可以使用 GetNextView 成員函式的反覆項目使用的 位置 值。

範例

//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 類別

階層架構圖表

CDocument::GetNextView