
There is a second problem: even if we set the 32-bit associated value of each item to be the same as the item's index this example will still not work. This is because the items will shift positions after each call to MyCompareProc(...) and the 32-bit associated values will no longer represent the item's index.
The function CListCtrl::SortItems(...) is only usefull if we store a pointer in the 32-bit associated value and we want to sort the items by some value that comes from that pointer.
|