Deleting the pointer of the allocated chunk is what is surely wrong.

Aside the rules set by Palm (which define how triggers/fields hold and
manipulate data) there is something that should be bothering you
additionally in that code: setting a simple buffer should not be that hard,
right? I mean, in the worst case, you should simply be able to use

char s[MAX_ITEM_PRICE_SIZE] and not bother with allocating dynamic memory.

If you *have* to allocate dynamic memory, it is often because you want it to
stay around for a while.

- bobby

-----Original Message-----
From: Matt Mason [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 19, 2001 12:41 PM
To: Palm Developer Forum
Subject: Trigger label changes bombing


When I change the label on a popup trigger with this:
{
 CharPtr s = MemPtrNew(sizeof(char[MAX_ITEM_PRICE_SIZE]));
 MemSet(s,MAX_ITEM_PRICE_SIZE,0);
 s = StrIToA(s,qty);
CtlSetLabel(GetObjectPtr(ItemEditQtyPopTrigger),s);
 MemPtrFree(s);
}
and then try to use the popup trigger on the form, I get an error reading
from an unallocated chunk.

What am I doing wrong?



-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to