COLLECT

The COLLECT sample illustrates a variety of the collection classes offered by the Microsoft Foundation Class Library for Windows CE (MFC CE).

The MFC collection classes can be classified according to shape and design, as follows:

Shapes:

Designs:

The COLLECT sample illustrates nine of these collections classes, representing a diverse combination of shapes and designs. Because the CTypedPtrArray and CTypedPtrList template-based collections are used differently, depending on whether they are being used to hold pointers to CObjects or to non-CObjects, the COLLECT sample illustrates both cases.

The nine collections illustrated by COLLECT are:

Shapes Non-Template Based Template-Based Simple Elements Template-Based TypeSafe Pointers
List CStringList CList CTypedPtrList

(of pointers)

Array CWordArray CArray CTypedPtrArray (of CObjects)
Map CMapStringToString CMap CTypedPtrMap

Additional COLLECT Features

In addition to illustrating the MFC collection classes, COLLECT also illustrates:

The Example menu lists the nine collection class illustrations. Each example presents a form view that exercises many of the common collection operations:

This sample demonstrates the following keywords:

CArchive::IsStoring CListBox::InsertString
CArray::Add CListBox::ResetContent
CArray::GetSize CListBox::SetItemDataPtr
CArray::RemoveAll CMap::GetNextAssoc
CArray::RemoveAt CMap::GetStartPosition
CCmdUI::SetCheck CMap::Lookup
CDataExchange::Fail CMap::RemoveAll
CDialog::DoModal CMap::RemoveKey
CFrameWnd::GetActiveView CObject::AssertValid
CFrameWnd::SetActiveView CObject::Dump
CList::AddTail CObject::Serialize
CList::Find CString::Empty
CList::GetHeadPosition CString::Format
CList::GetNext CString::LoadString
CList::InsertBefore CView::GetDocument
CList::RemoveAll CView::OnInitialUpdate
CList::RemoveAt CWinApp::AddDocTemplate
CListBox::AddString CWinApp::OnFileNew
CListBox::DeleteString CWnd::DestroyWindow
CListBox::FindString CWnd::UpdateData
CListBox::GetCurSel CWnd::ShowWindow
CListBox::GetItemDataPtr AfxMessageBox
CListBox::GetText SetWindowLong

You can find the COLLECT project files in the Wce\Samples\Mfc\COLLECT directory.

For information on the Windows CE platforms that support this sample, see MFC for Windows CE Samples.