Is there an Err value that is returned from MemPtrResize? It might be
that there isn't enough room after the chunk pointed to by
gPlayerName[nameIdx] to allocate the extra space for your bigger name. If
so, use MemPtrFree and MemPtrNew in place of MemPtrResize.
> >
> > if (gPlayerName[nameIdx] != NULL) {
> > if (MemPtrSize(gPlayerName[nameIdx]) < len)
> > MemPtrResize(gPlayerName[nameIdx], len);
> > } else
> > gPlayerName[nameIdx] = MemPtrNew(len);
> >
> > StrCopy(gPlayerName[nameIdx], name);
> >
> > MemHandleUnlock(h);
> >
> > trigger = GetObjectPtr(RaceSetupPopTrigger);
> > CtlSetLabel(trigger, gPlayerName[nameIdx]);
> >
> > This is working great to set the labels, and I can change the label
> > multiple times if I want. However, if I choose a name that is longer
> > than the previous label, I get a crash. I'm confused as to how to
> > keep that from happening.
> >
> > I set the initial label (via Constructor) to 20 spaces, as I know none
> > of my names are longer than 20 characters.
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
>please see http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/