Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CObList::RemoveAll
CObList                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  void RemoveAll();
 
  Remarks
 
  Removes all the elements from this list and frees the associated CObList
  memory. No error is generated if the list is already empty.
 
  When you remove elements from a CObList, you remove the object pointers
  from the list. It is your responsibility to delete the objects
  themselves.
 
  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;
 
 
 
                                     -♦-