title: Sorting a listview (Win32/C++)
body: <p>I'm trying to sort a listview when the user clicks on the column header.</p>
  
  <p>I am catching the LVN_COLUMNCLICK notification like so:</p>
  
  <pre><code>  case LVN_COLUMNCLICK:
    {
       NMLISTVIEW*    pListView   = (NMLISTVIEW*)lParam;
       BOOL test = ListView_SortItems ( m_hDuplicateObjectsList, ListViewCompareProc, pListView-&gt;iSubItem );
       break;
    }
  </code></pre>
  
  <p>However it seems to fail. My test variable is FALSE and my ListViewCompareProc never gets hit (it has a simple return 1 while I am trying to hit a debug point inside of it).</p>
  
  <p>Is there something I am missing for sorting a listview?</p>