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. LVN_COLUMNCLICK

LVN_COLUMNCLICK

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
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.
  • R Offline
    R Offline
    RK_2000
    wrote on last edited by
    #1

    I have a CListCtrl that is dynamically created. I am trying to add the columnclick event to it, but it doesn't seem to work. Any ideas why? this is what I am doing? Another question I have is how do you tell OnColumnClick which control you are refering to? I noticed that there are not IDs passed to it. in my .h I have this: //{{AFX_MSG(CFileView) ... afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult); ... //}}AFX_MSG in my .cpp BEGIN_MESSAGE_MAP(CFileView, CListCtrl) //{{AFX_MSG_MAP(CDetailsView) ON_NOTIFY_REFLECT(NM_DBLCLK, OnDoubleClick) //}}AFX_MSG_MAP void CControllerSelection::OnColumnClick(NMHDR * pNMHDR, LRESULT * pResult) { NM_LISTVIEW * pNMListView = (NM_LISTVIEW*) pNMHDR; m_ControllerList.SortItems(CompareFunc, pNMListView->iSubItem); *pResult = 0; }

    T 1 Reply Last reply
    0
    • R RK_2000

      I have a CListCtrl that is dynamically created. I am trying to add the columnclick event to it, but it doesn't seem to work. Any ideas why? this is what I am doing? Another question I have is how do you tell OnColumnClick which control you are refering to? I noticed that there are not IDs passed to it. in my .h I have this: //{{AFX_MSG(CFileView) ... afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult); ... //}}AFX_MSG in my .cpp BEGIN_MESSAGE_MAP(CFileView, CListCtrl) //{{AFX_MSG_MAP(CDetailsView) ON_NOTIFY_REFLECT(NM_DBLCLK, OnDoubleClick) //}}AFX_MSG_MAP void CControllerSelection::OnColumnClick(NMHDR * pNMHDR, LRESULT * pResult) { NM_LISTVIEW * pNMListView = (NM_LISTVIEW*) pNMHDR; m_ControllerList.SortItems(CompareFunc, pNMListView->iSubItem); *pResult = 0; }

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      First of all, decide if you're using CFileView, CControllerSelection or CDetailsView. Tomasz Sowinski -- http://www.shooltz.com

      Free your mind and your ass will follow.

      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