LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Get string control value from new panel error

After using:
 
int i_String;
char *str;
str = calloc(100, sizeof(char));
 
int i_NewPanel = NewPanel (0, "NEW PANEL", 10, 10, 200, 200);  
i_String = NewCtrl (i_Panel, CTRL_STRING, "String", 10, 10); 
 
DisplayPanel (i_NewPanel );
SetActivePanel (i_NewPanel );
 
GetCtrlVal (i_NewPanel , i_String, str);   ---> error = "expected pointer to char, found pointer to int"

How can I get string value (if someone enter before I execute the GetCtrlVal ... from i_String?
 
Thanks for any help.
 
0 Kudos
Message 1 of 4
(3,209 Views)

Oopp,  I am wrote in-corrected, the error was

error = "found pointer to char, expected pointer to int"

0 Kudos
Message 2 of 4
(3,203 Views)
It is working, I have an syntax error in my program ... so sorry! Smiley Sad
0 Kudos
Message 3 of 4
(3,195 Views)

This error happens when the data type that you pass to GetCtrlVal doesn't match the data type of the control.

In your case, I can tell that you are trying to get the value of the string, and passing a character array makes complete sense. But I also noticed that you are creating the string control in i_Panel, yet when you try to get the value, you are using i_NewPanel. So you are inadvertently referencing a different control, in a different panel, which is probably not a string.

Luis

 

Ah, well, it looks like you figured it out. Never mind Smiley Happy

Message Edited by LuisG on 02-13-2007 11:09 AM

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