how many rows of data?
-mouser
Doesn't matter be it 3 or 300 (Most I ever tried was 2000) behavior is the same.
Never heard of such a bug (but not saying it can't exist
).
How do you manage the items? virtual mode, or letting the control manage strings internally?
-f0dder
If I'm understanding the question correctly, the control is managing internally. I'm not doing anything OwnerDrawn/Clever it's just a fairly straight forward ListView_InsertColumn(...) ListView_InsertItem(...) sort of affair.
This is basically the sort code I'm using (from an older 7 column version of the app):
#include "stdafx.h"
extern HWND g_hListBox;
extern int nSortDir[7];
int CALLBACK ListViewCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) {
static char szBuf1[100], szBuf2[100];
int i1, i2;
//=================================== Retrieve the item text so we can compare it.
ListView_GetItemText(g_hListBox, lParam1, (int)lParamSort, szBuf1, sizeof(szBuf1));
ListView_GetItemText(g_hListBox, lParam2, (int)lParamSort, szBuf2, sizeof(szBuf2));
//============================================= Then Return the Comparison Results.
if(lParamSort >= 5) { //================= Sort PageCount Columns 5 & 6 as a Number.
i1 = strtol(szBuf1, 0, 10);
i2 = strtol(szBuf2, 0, 10);
if(nSortDir[lParamSort]) //========= Toggle Between ASCENDING & DESCENDING ORDER
return i1-i2; //====================================== Sort Order ASCENDING
else
return i1+i2; //===================================== Sort Order DESCENDING
}else{ //========================= Sort ALL the Rest (Alphabetically) as a String.
if(nSortDir[lParamSort]) //========= Toggle Between ASCENDING & DESCENDING ORDER
return(_stricmp(szBuf1, szBuf2) * -1); //=============== Sort Order ASCENDING
else
return(_stricmp(szBuf1, szBuf2)); //=================== Sort Order DESCENDING
}
}
It was probably 2 years ago when I saw the bugg discussion ... thinking that I'd never need to use that many columns I ignored it and moved on to other more (at the time) relevant issues. Now I'm racking my brain trying to remember where I'd seen it because (several columns later) the bugg is now gnawing my ass off
