LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with GetCtrlVal(), RUN TIME ERROR Compiling a CVI 5.0 Source with CVI 8.0

Hello everybody,
 
I have little problem. We got the new 8.0 version of CVI.
Today I wanted to compile an old source written in CVI 5.0.
But now there appear several NON FATAL RUN TIME ERRORS:
 
GetCtrlVal (panelHandle, str_module[mod].ctrl_filename, str_module[mod].filename);
 
str_module[mod].ctrl_filename is equivalent to an control ID on my GUI
 
The error wich appears is:
 
return value -13
Invalid control ID
 
It is strange! In CVI 5.0 everything worked correct.
What is the problem? Can you help me?
Maybe it is a problem in the header file.
Is it possible to create a new header of my .uir File.
0 Kudos
Message 1 of 6
(3,970 Views)
Hi ThiloV,
   The prototype for GetCtrlVal is:
     

           int GetCtrlVal (int Panel_Handle, int Control_ID, void *Value);

   so Control_ID is meant to be integer.  How is defined str_module[mod].ctrl_filename ?    You can put there a MACRO, but not a string. 

   If, instead of the variable, you put the number of your control, generated by CVI and stored in .h file for uir resource, do you still get the error?

   Please, let me know!!!!

   Greetings

graziano

0 Kudos
Message 2 of 6
(3,960 Views)

Hi Graziano,

thank you for your reply.

str_module[mod].ctrl_filename  is an integer. It is a part of a struct in my source.

>>If, instead of the variable, you put the number of your control, generated by CVI and stored in .h file for uir resource, do you still get the error?

I tried this, but I still get the error. I don't understand what is wrong.

Do you have an idea?

Greetings

Thilo

0 Kudos
Message 3 of 6
(3,944 Views)
Hi Thilo,
   I'm really sorry, but I've no idea of what's going on......

   Can you post some files? Especialy the .h (header) containing the user interface controls IDs, and can you post the chunk of code where you define the structure containing str_module[mod].ctrl_filename definition?? I mean the typedef struct ....

   Unfortunately, I can't assure you this may help.....

    Greetings!

graziano

0 Kudos
Message 4 of 6
(3,940 Views)

Hello Graziano,

Thank you for your help. In the mean time I found the mistake.

It was a problem with the Panel Handle.

But it is very strange that CVI 5.0 never showed this error.

Bye

Thilo

 

0 Kudos
Message 5 of 6
(3,932 Views)
OK!
   It's always useful to report strange behaviours!

   Have a nice day!


graziano
0 Kudos
Message 6 of 6
(3,926 Views)