如何调用CObList::IsEmpty()??
本浪 2001-04-19 02:50:00 编译报错:error C2039: 'IsEmpty' : is not a member of 'CObject'
可是MSDN上却有如下内容
CObList::IsEmpty
BOOL IsEmpty( ) const;
Return Value
Nonzero if this list is empty; otherwise 0.
Remarks
Indicates whether this list contains no elements.
Example
CObList list;
CAge* pa1;
CAge* pa2;
ASSERT( list.IsEmpty()); // Yes it is.
list.AddHead( pa1 = new CAge( 21 ) );
list.AddHead( pa2 = new CAge( 40 ) ); // List now contains (40, 21).
ASSERT( !list.IsEmpty()); // No it isn't.
list.RemoveAll(); // CAge's aren't destroyed.
ASSERT( list.IsEmpty()); // Yes it is.
delete pa1; // Now delete the CAge objects.
delete pa2;