LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Out-of-bounds pointer argument (before start of array).

Hello,
 
I'm having a weird problem:
 
In a function, I declare a string "char label_str[20]".
Later in this function, I want to use this string to hold the label of a picture control. So I use the function
GetCtrlAttribute (my_panel, my_picture_control, ATTR_LABEL_TEXT, label_str);
When the debugger executes this function, I get a FATAL RUN_TIME ERROR: Out-of-bounds pointer argument (before start of array).
Labwindows is indicating 'label_str' in the GetCtrlAttribute function (marked in blue).
 
I really have no idea what's causing this error. Smiley Sad
so all hints and tips are really welcome...
 

Message Edited by Wim S on 01-06-2006 12:21 PM

0 Kudos
Message 1 of 4
(4,893 Views)
Hi!

   I think defining your string as
   
   char *label_str;

    label_str=malloc(20*sizeof(char));

   etc....

   should solve.


  I've also found this, in CVI help:

Constant:  ATTR_LABEL_TEXT
Data Type:  string (char *)
Description:  The text label for the control.
   
Control Types:  All except Text Message, Decoration, Splitter

In the description of ATTRIBUTE VALUE for GetCtrlAttribute() function.

Let me know how you managed this problem!!!!

graziano

Message 2 of 4
(4,886 Views)

Hi Graziano,

Thanks a lot. Your solution seems to work.

Message 3 of 4
(4,882 Views)
Hi!
   Thanks for feeding me back! Smiley Very Happy

graziano
0 Kudos
Message 4 of 4
(4,878 Views)