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. Listbox SendMessage with LV_DISPINFO

Listbox SendMessage with LV_DISPINFO

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
1 Posts 1 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.
  • C Offline
    C Offline
    Chris Klecker
    wrote on last edited by
    #1

    I'm trying to send a message from my ListBox custom class to another class which utilizes the control. In the Listbox control I build a LV_DISPINFO struct and then pass it to a SendMessage method to be used by the OnNotify message in the calling class. In this example CCreateWorldStep1Dlg uses the ListBox custom control whereas the ListBox custom control passes a message back to CCreateWorldStep1Dlg as a Notify message. void CCreateWorldStep1Dlg::OnNotify(UINT message, LPARAM lParam) { CString Buffer; LV_DISPINFO *pInfo = (LV_DISPINFO *)lParam; pListBox->GetText(pListBox->GetCurSel(), Buffer); if(pListBox->GetCurSel() == pListBox->GetCount() - 1) pRegionsArray->Add(Buffer); else pRegionsArray->SetAt(pListBox->GetCurSel(), Buffer); } The problem is that variable pInfo contains garbage when I look at it. May I be converting the lParam incorrectly? This is how I am sending the message GetParent()->GetParent()->SendMessage(WM_NOTIFY, m_DlgID, (LPARAM)&dispinfo); Thanks for the help "Why are we hiding from the police, Daddy?" "We use VI, son. They use Emacs."

    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