08-31-2010 03:02 AM
Hi !
I have a general question...
I'm workign with CVI 9.1 , and i have serveral C files .
At the main.c file I'm loading all my panels for ex Panel Name - PREF, Panel Handle - panelPrefHandle
At the service.c file I'm trying to use GetCtrlVal(panelPrefHandle,....,...);
OR GetCtrlVal(PREF,....,...);
At service.c i'm including #include "main.h"
Still I'm getting the error :
NON-FATAL RUN-TIME ERROR: "Service.c", line 677, col 29, thread id 0x00000D30: Library function error (return value == -42 [0xffffffd6]). The handle is not a panel handle
so my question is how can i pass panel handel over serveral c files ?
08-31-2010 03:22 AM - edited 08-31-2010 03:23 AM
Hi,
you need to include the include file of the panel: if you build and save a panel in the UIR editor, a corresponding *.h file is generated; you need to include this file in the *.c file which will access this panel, because the panel name etc. are defined in the panels' include file.
Hth, Wolfgang
08-31-2010 04:18 AM
I know thats what i did .
But still it doesn't recognize the panelHandle
08-31-2010 04:40 AM
08-31-2010 07:25 AM
Declaring you panel handle as a global works, you can also just pass the handle to the function as an integer:
yourFunction(int PanelHandle)
and use it inside your function as needed.