本帖最后由 nicholascage 于 2010-12-17 10:53:27 编辑

解决方案 »

  1.   

    有个CListCtrl的派生类,可以完成你的工作,
      

  2.   

    对这个不是太熟,但是MSDN中LVM_SORTITEMS 的解释有这么一段:Note  During the sorting process, the list-view contents are unstable. If the callback function sends any messages to the list-view control aside from LVM_GETITEM (ListView_GetItem), the results are unpredictable.
      

  3.   

    SortItems前加
    int i = GetItemCount();   
    for (int k=0;k<i;k++)   
    {   
    SetItemData(k,k);   
      

  4.   

    已经在别的函数里调用SetItemData过了。