I am using a WTL list control.
when i use the control with records more than 10000,
the application gets hang, and it takes too much
time. Where the same code used with commctrl's
listview, i have no problem in adding any number of
records.
*******************************The code
snippet************************
for (DWORD i = 0; i < dwCount; i++) {
LVITEM lvi = {LVIF_TEXT|LVIF_PARAM};
lvi.iItem = i; lvi.lParam = i;
char text[0x8000]; lvi.pszText = text;
//State
lstrcpy(text,pStates[i]);
lvi.iSubItem = 0; lvi.iItem = (int)SendMessage
(m_hwndListFiles,LVM_INSERTITEM,NULL,
(LPARAM)&lvi);
//Name
WideCharToMultiByte(CP_ACP,0,pwszNameExt[i],-
1,text,ARRAYSIZE(text),NULL,NULL);
lvi.iSubItem = 1; lvi.mask = LVIF_TEXT;
SendMessage(m_hwndListFiles,LVM_SETITEM,NULL,
(LPARAM)&lvi);
//Location
WideCharToMultiByte(CP_ACP,0,pwszLocation[i],-
1,text,ARRAYSIZE(text),NULL,NULL);
lvi.iSubItem = 2; SendMessage
(m_hwndListFiles,LVM_SETITEM,NULL,(LPARAM)&lvi);
//Size
SizeToStr(text,ullSize[i]);
lvi.iSubItem = 3; SendMessage
(m_hwndListFiles,LVM_SETITEM,NULL,(LPARAM)&lvi);
}
*******************************End of
code******************************
When i use this in project where common controls
{commctrl.h} is used, it works in less than a second
for 7000 records, but wen used in any VisualStudio
Environment with WTL, it takes more than 100 seconds.
Can you help me on this.
This shows the time taken by two methods used for populating a List control with same set of data using same code