CTreeCtrl中调用SortChildrenCB()后,为什么没反应?
oiq 2003-07-01 02:21:51 int CALLBACK MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// lParamSort contains a pointer to the tree control.
// The lParam of an item is just its handle,
// as specified with SetItemData
CTreeCtrlEx2 * pTree = (CTreeCtrlEx2 *) lParamSort;
HTREEITEM hItem1 = (HTREEITEM) lParam1;
HTREEITEM hItem2 = (HTREEITEM) lParam2;
CString strItem1 = pTree->DoLocStringFromItem(hItem1);
CString strItem2 = pTree->DoLocStringFromItem(hItem2);
return strcmp(strItem2, strItem1);
}
TVSORTCB tvs;
tvs.hParent = TVI_ROOT;
tvs.lpfnCompare = MyCompareProc;
tvs.lParam = (LPARAM) this;
BOOL b = SortChildrenCB(&tvs);
执行这句后,按理说应该调用上面的回调函数,但却没有调,这是为何!