EditBox->getText()

4 posts / 0 new
Last post
turbo@bayour.com
turbo@bayour.com's picture
Offline
Mobile Conjurer
Joined: 25 Feb 2010
Posts:
EditBox->getText()

I get 'Data memory access out of bounds' when trying to get the value from a EditBox. My bad, or bug in MoSync?

String value = editBoxScreens[0]->editBox[3]->getText();

If I insted have the following it works.

char *value = (char *)editBoxScreens[0]->editBox[3]->getText().c_str();

but then I get into other problems, especially if the EditBox is empty...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fatalerror
fatalerror's picture
Offline
Mobile Conjurer
Joined: 2 Oct 2009
Posts:

Hi FransUrbo,

I can't really tell you anything from the information you have given me, but it sounds like a bad pointer. Can you isolate the problem and give us a small program in which this happens?

turbo@bayour.com
turbo@bayour.com's picture
Offline
Mobile Conjurer
Joined: 25 Feb 2010
Posts:

Unfortunatly I can't even reproduce it myself!! But I get the problem in the main/original program. And it only shows in some cases (some changes makes it resurface and some it wanishes). Weird. I'll keep looking

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

It sounds very much like a memory error. I used to get this a lot. Check that you are instancing all of you variables properly and are releasing them. Check http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization for helpful advice.