At 10:40 AM 2/19/2001, Matt Mason wrote:
>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?
You're freeing the chunk too soon. The form needs to be able to read from this chunk
to display the label. That means the chunk needs to stick around until the form is
closed.
--
Peter Epstein
Palm Inc. Developer
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/