CListCtrl sorting problem
-
Hi! I'm new using CListCtrl and i've been reading some articles how to sort it's columns in the Report mode. I've a class derived from CHeaderCtrl que does it, but i must pass two arguments, the iSubItem of the column and if i want to sort ASC or DESC, i'm doing like this: void CExeptions::OnColumnclickCombo1(NMHDR* pNMHDR, LRESULT* pResult) { int iB=0; NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; LVITEM lvi; LVCOLUMN col; col.mask = LVM_GETCOLUMN; ListCtrl.GetItem(&lvi); iB=col.iSubItem; m_headerctrl.SetSortImage(iB, true); *pResult = 0; } but i can't get the value of the iSubItem. What am i doing wrong? Thank you for your time
-
Hi! I'm new using CListCtrl and i've been reading some articles how to sort it's columns in the Report mode. I've a class derived from CHeaderCtrl que does it, but i must pass two arguments, the iSubItem of the column and if i want to sort ASC or DESC, i'm doing like this: void CExeptions::OnColumnclickCombo1(NMHDR* pNMHDR, LRESULT* pResult) { int iB=0; NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; LVITEM lvi; LVCOLUMN col; col.mask = LVM_GETCOLUMN; ListCtrl.GetItem(&lvi); iB=col.iSubItem; m_headerctrl.SetSortImage(iB, true); *pResult = 0; } but i can't get the value of the iSubItem. What am i doing wrong? Thank you for your time
sorry, i miscopy the line iB=col.iSubItem;, its iB=lvi.iSubItem; unfortunally, that was not the problem :)