I have a CListCtrl in a CDialog on which I capture the ON_NOTIFY message LVN_COLUMNCLICK, and then depending upon whether we're doing an ascending or descending sort I set the sort icon. This is my code:
The sort icon (either up or down) is correctly set in debug mode but is strangly absent in release mode. In release mode the code is executed but no icon is showing in the header of the column clicked on. Anyone any ideas why not?
I have Owner Data set to true on as I populate the List CTRL via the message LVN_GETDISPINFO.
If I then use the CMFCListCtrl rather than the CListCtrl, when I go to sort the data I get an assertion in the CListCtrl::SortItems called from CMFCListCtrl::Sort() which passed the CMFCListCtrl::CompareProc
I have decided to write a small CMFCListCtrl extension class that overrides the Sort function in which I then send a windows registered message which I then deal with in my dialog: