Um, you cant free the memory before the trigger is done using it!  Please
read about CtlSetLabel in the docs, pay special attention to the warning in
the comments section.  Also, your variable 'H' must outlive the trigger.

----- Original Message -----
From: "manish jaggi" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, July 13, 2001 12:54 AM
Subject: Selector trigger Problem


>
> I got this error Using POSE  when i clicked on my selector trigger second
time.
> The application has just read directly from an unallocated chunck of
memory
> case EditTimeSelTrigger:
> SelectOneTime(&PersonRecord.Hours,&PersonRecord.Minutes,"SetTime");
>
SetTime(PersonRecord.Hours,PersonRecord.Minutes,(ControlType*)GetObjectPtr(E
ditTimeSelTrigger));
>
> Boolean SetTime(int hh, int mm,ControlPtr ctrl)
> {
>  Char* time;
>  MemHandle H = MemHandleNew(13);
>  time = (Char *)MemHandleLock(H);
>  TimeToAscii (hh,mm,tfColonAMPM, time) ;
>  CtlSetLabel(ctrl,time);
>  MemHandleUnlock(H);
>  MemHandleFree(H);
>  return true;
> }
> Can anyone  help  me out ?
> Manish
>
>
> --------------------------------------------------------------------------
------
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> --
> 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