void SheetView::OnSort()
{
CListCtrl &p=GetListCtrl();
p.SortItems((PFNLVCOMPARE)CompareFunc,LPARAM(&p));
/*p.RedrawItems(0,3);
UpdateWindow();*/
}
int CALLBACK SheetView::CompareFunc(LPARAM lParam1,LPARAM lParam2,LPARAM lParamSort)
{
CListCtrl *p=(CListCtrl*)lParamSort;
CString item1=p->GetItemText((int)lParam1,0);
CString item2=p->GetItemText((int)lParam2,0);
//item1.Format("%d",item1.Compare(item2));
AfxMessageBox((LPCTSTR)item1);
AfxMessageBox((LPCTSTR)item2);
//CListCtrl* pListCtrl = reinterpret_cast<CListCtrl*>(lParamSort);
return 1;//;//;//1;}AfxMessageBox((LPCTSTR)item1);
AfxMessageBox((LPCTSTR)item2);
这两个输出相同的字段...为什么呢?
{
CListCtrl &p=GetListCtrl();
p.SortItems((PFNLVCOMPARE)CompareFunc,LPARAM(&p));
/*p.RedrawItems(0,3);
UpdateWindow();*/
}
int CALLBACK SheetView::CompareFunc(LPARAM lParam1,LPARAM lParam2,LPARAM lParamSort)
{
CListCtrl *p=(CListCtrl*)lParamSort;
CString item1=p->GetItemText((int)lParam1,0);
CString item2=p->GetItemText((int)lParam2,0);
//item1.Format("%d",item1.Compare(item2));
AfxMessageBox((LPCTSTR)item1);
AfxMessageBox((LPCTSTR)item2);
//CListCtrl* pListCtrl = reinterpret_cast<CListCtrl*>(lParamSort);
return 1;//;//;//1;}AfxMessageBox((LPCTSTR)item1);
AfxMessageBox((LPCTSTR)item2);
这两个输出相同的字段...为什么呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货