Creating the List Control
How the list control () is created depends on whether you're using the control directly or using class instead. If you use CListView, the framework constructs the view as part of its document/view creation sequence. Creating the list view creates the list control as well (the two are the same thing). The control is created in the view's handler function. In this case, the control is ready for you to add items, via a call to .
To use CListCtrl directly in a dialog box
In the dialog editor, add a List Control to your dialog template resource. Specify its control ID.
Use ClassWizard to add a member variable of type CListCtrl with the Control property. You can use this member to call CListCtrl member functions.
Use ClassWizard to map handler functions in the dialog class for any list control notification messages you need to handle.
In , set the styles for the CListCtrl. See Changing List Control Styles. This determines the kind of "view" you get in the control, although you can change the view later.
To use CListCtrl in a nondialog window