06-29-2009 12:15 PM
LabWindows CVI 9.0.1 (375)
Windows XP Pro
I am getting Library Function Error (return value == -55(0xffffffc9) The index passed is out range.
The code snippet is:
/**START**/
GetNumListItems(panelHandle,PANEL_LISTBOX,&ListCount);
if(0 != ListCount)
SetCtrlIndex(panelHandle,PANEL_LISTBOX,(ListCount-1));
/**END**/
The error occurrs in the SetCtrlIndex function.
Also, I see the same error in similar code:
/**START**/
GetNumListItems(panelHandle,PANEL_LISTBOX,&TotalCount);
GetLabelFromIndex(panelHandle,PANEL_LISTBOX,(TotalCount - 1), LabelBuff);
/**END**/
The error occurrs in the GetLabelFromIndex function.
The number of list items is greater than zero in both cases.
Any Ideas?
Rodney
06-30-2009 07:52 AM
Hi Rodney
I tried to reproduce this here.
But it works.
Attached you get the project.
06-30-2009 07:52 AM
Hi Rodney
I tried to reproduce this here.
But it works.
Attached you get the project.
06-30-2009 08:01 AM
My project uses a llistbox as a text box to write status information to a user. The updates to the listbox occur randomly. I have a callback function attached to an async timer at 0.2 second to do this:
/**START**/
GetNumListItems(panelHandle,PANEL_LISTBOX,&ListCount);
if(0 != ListCount)
SetCtrlIndex(panelHandle,PANEL_LISTBOX,(ListCount-1));
/**END**/
It does not happen all the time but it happens enough to cause potential problems. Every time the debugger breaks on the library error, I inspect the value of ListCount. The value is always greater than zero. So, when I subtract one, I should have a valid index into the listbox but I still get the Library Function Error (return value == -55(0xffffffc9) The index passed is out range.
Rodney
06-30-2009 08:15 AM