LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NweCtrl, Tooltips,InstallCallback, DiscardCtrl, causes a RuntimeError in DebugMode

if i build dynamic controls in my uir with NewCtrl,
add tooltips SetCtrlToolTipAttribute , install a ctrlcallback with InstallCtrlCallback and later i would
remove the ctrl with DiscardCtrl , in debug mode a non fatal runtime error occured (err 13 , wrong control id). i have added the function call to
the toolbox-sample list.c , so i can reproduce the error there too.
i haven't found a error in my software, what's
the reason for this error ? did anyone know this problem ?
0 Kudos
Message 1 of 3
(3,362 Views)
This usually means you are trying to discard the control with a wrong
panelHandle.
Try to compare the panelHandle passed to NewCtrl with the panelHandle
passed to DiscardCtrl.


volker wrote in message news:<50650000000800000090ED0000-1079395200000@exchange.ni.com>...
> if i build dynamic controls in my uir with NewCtrl,
> add tooltips SetCtrlToolTipAttribute , install a ctrlcallback with
> InstallCtrlCallback and later i would
> remove the ctrl with DiscardCtrl , in debug mode a non fatal runtime
> error occured (err 13 , wrong control id). i have added the function
> call to
> the toolbox-sample list.c , so i can reproduce the error there too.
> i haven't found a error in my software, what's
> the reason for this error ? did anyone know this problem ?
>
--
0 Kudos
Message 2 of 3
(3,362 Views)
Volker,

as far as i looked upon your added code, the problem will most likely be located in the way you discard the control. you are discarding the control in the following function:
int CVICALLBACK ChangeItemCallback (int panel, int control, int event,
void *callbackData, int eventData1,
int eventData2)
{
switch (event)
{
case EVENT_VAL_CHANGED:
DiscardCtrl(panel,iNewCtrl);

if (g_myList)
UpdateUIR (panel);
break;
}
return 0;
}

referring to the CVI-help, DiscardCtrl has to be used:
LabWindows/CVI does not allow you to call DiscardCtrl from the callback function for the control, except in res
ponse to a commit event.

please review your code and uir if this could be the reason...

- Norbert B.
NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 3
(3,362 Views)