ItemData in a virtual list control
-
I am using a virtual list control, in the message LVN_GETDISPINFO i am setting the text but how can i set the ItemData. ON_NOTIFY(LVN_GETDISPINFO, ID_LIST, GetDispInfo) void CWndEx::GetDispInfo(NMHDR* pNMHDR, LRESULT* pResult) { LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; LV_ITEM* pItem= &(pDispInfo)->item; if (pItem->mask & LVIF_TEXT) { //Comes here } if(pItem->mask & LVIF_PARAM) { //NEVER COMES } } When i call m_ListCtrl.GetItemData(nRow) it allways returns 0 and never comes to the GetDisplayInfo function. Do you set the ItemData some other way or just handle getting the ItemData in your own function? Any Ideas?
-
I am using a virtual list control, in the message LVN_GETDISPINFO i am setting the text but how can i set the ItemData. ON_NOTIFY(LVN_GETDISPINFO, ID_LIST, GetDispInfo) void CWndEx::GetDispInfo(NMHDR* pNMHDR, LRESULT* pResult) { LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; LV_ITEM* pItem= &(pDispInfo)->item; if (pItem->mask & LVIF_TEXT) { //Comes here } if(pItem->mask & LVIF_PARAM) { //NEVER COMES } } When i call m_ListCtrl.GetItemData(nRow) it allways returns 0 and never comes to the GetDisplayInfo function. Do you set the ItemData some other way or just handle getting the ItemData in your own function? Any Ideas?
I don't believe you can set the item data using callbacks. Only the text and image index can be set that way. You would set the item data either whenever you add the item to the control (InsertItem) or with SetItemData after it's added.