CList::GetSize

返回数字列表元素。

INT_PTR GetSize( ) const;

返回值

列表中的项数。

备注

调用此方法检索元素数列表中的。 调用此方法将生成结果和 CList::GetCount 方法相同。

示例

// Define myList.
CList<CString,CString&> myList;

// Add two elements to the list.
myList.AddHead(CString(_T("ABC")));
myList.AddHead(CString(_T("123")));

// Remove the head element and verify the list.
// NOTE: once the head is removed, the number of
// elements in the list will be one.
CString strHead = myList.RemoveHead();
ASSERT((CString(_T("123")) == strHead) && (myList.GetSize() == 1) && 
   (CString(_T("ABC")) == myList.GetHead()));      

要求

Header: afxtempl.h

请参见

参考

CList选件类

层次结构图

CList::GetCount