I have an issue with the Combo Boxes being very slow in Visual Studio 2005.
I have a dialog with 15 combo boxes and I fill them up in InitDialog using
::SendMessage(pCtl->m_hWnd, CB_ADDSTRING , 0, (LPARAM) "TestString");
This seems to take long and is affecting the performance of my program. I did the same exact code in Visual C++ 6.0 and it comes up quite fast. Did a tick count for the function and Visual Studio took around 750 milliseconds while Visual C++ 6.0 took only 15 !
Am I doing something wrong here ?
Here is the full code:
CWnd *pCtl;
int cid, clrId;
for (cid = LB_LIST1; cid <= LB_lIST_LAST; cid++)
{
pCtl = GetDlgItem(cid);
for(clrId = 0; clrId < 21; clrId++)
{
::SendMessage(pCtl->m_hWnd, CB_ADDSTRING , 0, (LPARAM) "testString");
}
::SendMessage(pCtl->m_hWnd, CB_SETCURSEL, 0, (LPARAM)0);
}
(The ids for the Combo Boxes are defined as LB_LIST1 to LB_LIST_LAST in consecutive numbers.)
Appreciate any help!
Thank you.