CListCtrl selection problem

This is a discussion on CListCtrl selection problem within the Windows Programming forums, part of the Platform Specific Boards category; Hi.
In my program I have a ListView control in report mode, which is associated with a CListCtrl object(MFC). I ...

CListCtrl selection problem

Hi.

In my program I have a ListView control in report mode, which is associated with a CListCtrl object(MFC). I need to know which items are selected at a moment. Something like the function CListBox::GetSel().

Use GetSelectedCount() to get the number of selected items. Then use GetFirstSelectedItemPosition() to get the first selected item. Then you use GetNextSelectedItem() to iterate through the selected items.