LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Library function Error(return value == -42)

When I compiled code from CVI Labwindows 7.1.1 with CVI LabWindows 9.0, I get the error "Library function Error(return value == -42)" while debugging.

I am using Easytab and accessing a control on a different tab on the same panel. It works under CVI LabWindows 7.1.1?

0 Kudos
Message 1 of 4
(3,730 Views)
In case like yours, a snippet of code could be bery helpful to understand what's happening. In any case, error -42 states that "The handle is not a panel handle" (you can decode it by passing,  the error code to GetGeneralErrorString ()  function); that is, you are passing an incorrect value to some function. Using the easytab instrument is not so obvious, since it often happens to use incorrect handles to address the controls on the tab pages (which are loaded as child panels of the panel the EasyTab control is on and have their own individual handle), so if you cannot get where the error is you can place a breakpoint near the line on error and execute the code step-by-step checking the values of all variables passed to the functions.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,721 Views)

 

 

 my_tab = (G_TAB_SET_REC *)(gcurrent_win->tab_set_ptr);

 tab_idx_LOTR = get_tab_rec_idx(my_tab,LOTR_TAB);

 ResetTextBox (my_tab[tab_idx_LOTR].handle,LOTR_TAB_LOT_TABLE, '\0');

 

 I did a side by side debug one computer running CVI 7.1.1 and another computer running CVI 9.0. the values of the handle and control are the same going into the ResetTextBox function. When the CVI 9.0 code tries to execute the ResetTextBox it returns the function error, but the CVI 7.1.1 computer works fine. If I run the CVI 9.0 compiled code on the CVI 7.1.1 computer it works fine.

 

Any help would be appreciated

Thanks,

Jeff

0 Kudos
Message 3 of 4
(3,714 Views)

I have noticed that some CVI controls are unhappy in receiving a NULL pointer in place of an empty string. It is possible that this behaviour has changed for the ResetTextBox() function between V.7 and V.9.  Instead of:

 

    ResetTextBox (my_tab[tab_idx_LOTR].handle,LOTR_TAB_LOT_TABLE, '\0') ; 

 

where the final NUL character is interpreted as a NULL pointer, try using:

 

    ResetTextBox (my_tab[tab_idx_LOTR].handle,LOTR_TAB_LOT_TABLE, "") ; 

 

where it is a conventional empty string.

 

JR

0 Kudos
Message 4 of 4
(3,685 Views)