> Sorry for the flurry of questions.  I'm trying to fix up the final
> problems in my app now.  As far as I know, this is the last bug....
> 
> I have a trigger that gets its value from a database.  I've got my
> event handler calling the following code when a ctlSelectEvent for
> the trigger is received:
> 
>               listSel = LstPopupList(...);
> 
>               h = DmQueryRecord(gPlayerNamesDB, listSel);
>               name = MemHandleLock(h);
>               
>               len = StrLen(name) + 1;
>               
>               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/

Reply via email to