LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Working with multiplie Panels And C Files

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 ?

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 1 of 5
(3,389 Views)

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

0 Kudos
Message 2 of 5
(3,384 Views)

I know thats what i did .

 

But still it doesn't recognize the panelHandle

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 3 of 5
(3,381 Views)

See here.

 

JR

0 Kudos
Message 4 of 5
(3,375 Views)

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.

0 Kudos
Message 5 of 5
(3,357 Views)