Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ItemData in a virtual list control

ItemData in a virtual list control

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gilfrog
    wrote on last edited by
    #1

    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?

    P 1 Reply Last reply
    0
    • G Gilfrog

      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?

      P Offline
      P Offline
      Phil Hamer
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups