The CStringList class supports lists of CString objects. All comparisons are done `by value', meaning that the characters in the string are compared instead of the addresses of the strings.
The member functions of CStringList are similar to the member functions of class CObList Because of this similarity, you can use the CObArray reference documentation for member function specifics. Wherever you see a CObject pointer as a return value, substitute a CString. Wherever you see a CObject pointer as a function parameter, substitute a const pointer to char.
CObject*& CObList::GetHead() const;
for example, translates to
CString& CStringList::GetHead() const;
and
POSITION AddHead( CObject* <newElement> );
translates to
POSITION AddHead( const char* <newElement> );
CStringList incorporates the IMPLEMENT_SERIAL macro to support serialization and dumping of its elements. If a list of CStrings is stored to an archive, either with the overloaded insertion operator or with the Serialize member function, each CString element is, in turn, serialized.
If you need a dump of individual CString elements, you must set the depth of the dump context to 1 or greater.
When a CStringList object is deleted, or when its elements are removed, the CString objects are deleted as appropriate.
#include <afxcoll.h>