Hi everyone:
Thank you for your attention.
I am using List Box Control to display test information, but occur error, the hint is out of index range.
I list part relative code for you, maybe you can find some clues and help me .
//====================================================
#define TEST_STATUS_MAX_SIZE ((long) 102400)
long GUI_TestStatus_Write (char *svalue_in)
{
long lreturn = GUI_ERR_NONE;
int ilist_item_count = 0;
if (iMainPanelHandle > 0)
{
lreturn = (long) GetNumListItems (iMainPanelHandle, MAINPANEL_LISTBOX_TESTSTATUS, &ilist_item_count);
if ( ilist_item_count > TEST_STATUS_MAX_SIZE )
{ //max data allowed exceeded. clear window.
lreturn = (long) ClearListCtrl (iMainPanelHandle, MAINPANEL_LISTBOX_TESTSTATUS);
}
lreturn = (long) InsertListItem (iMainPanelHandle, MAINPANEL_LISTBOX_TESTSTATUS, -1, svalue_in, 0);
if (AUTOSCROLL_ENABLE == iAutoScroll)
{
if (ilist_item_count >= 1)
{
lreturn = (long) SetCtrlIndex (iMainPanelHandle, MAINPANEL_LISTBOX_TESTSTATUS, (ilist_item_count-1));
}
}
}
return lreturn;
}
//====================================================
the system break down in SetCtrlIndex (), i do not know how to resolve it
Thank you in advance!