Windows ListView Control Returns -1 From LVM_INSERTITEM

12 Jan 2004 12:21 mfc

I just spent the best part of a morning chasing this one down, so I thought I’d share it with you:

If you try calling CListCtrl::InsertItem (or LVM_INSERTITEM), using LPSTR_TEXTCALLBACK, you can’t use either of the LVS_SORTASCENDING or LVS_SORTDESCENDING styles for the list view.