[EMAIL PROTECTED] wrote:
>Static is necessary for the label text pointer. CtlSetLabel() stores the
>new label pointer in the control's data structure.  It does not make a copy
>of the text.  Take a look at the comments under CtlSetLabel() in Palm OS
>SDK Reference (SDK 4.0).

The code Igor posted allocated memory for the label using MemPtrNew().
That memory stays allocated until freed by MemPtrFree(); it makes no
difference whether you store a copy of the pointer in a static
variable.  (If the variable weren't static, the only thing that would
go out of scope is the pointer variable itself, not the memory it
points to.)

-- 
    -M-                                              [EMAIL PROTECTED]

-- 
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