tnx,
u have been very helpful :-)))))

"Ben Combee" <[EMAIL PROTECTED]> wrote in message
news:34017@palm-dev-forum...
>
> "Eliah NInyo" <[EMAIL PROTECTED]> wrote in message
> news:34007@palm-dev-forum...
> >
> > hello,
> >
> > i want to ask if any1 know of a function that return a CharPtr value
from
> a
> > given handle valuse.
> >
> > i mean i have a handle to one of my memory allocations (handle to a
record
> > field - with MemHandleNew) and i get a pointer to this handle (with
> > MemHandleLock). i copy some text to this pointer by StrCopy and than i
> > unlock the poiter (with MemPtrUnlock).
> >
> > later in the same code function i need to use the text i entered to the
> > poiter (of the handle) to be the text of one of my controle resources (
> > withe CtlSetLabel ) and i want to know if there is a function that i can
> use
> > to get the text i put in my handle to be a CharPtr value????
>
> Its called pointer casting... MemHandleLock does two things:
>
> 1) It prevents the memory associated with the handle from being moved by
the
> OS.
> 2) It returns a void pointer to that locked region.
>
> You can then turn the void pointer into a Char pointer for use with
> functions like CtlSetLabel.
>
>     Char *pc = (Char *) MemHandleLock(handle);
>     CtlSetLabel(ctl, pc);
>
> You will need to leave the handle locked until the control has its label
> changed or until it is no longer displayed, because you can't be sure when
> the PalmOS will need to redraw the control, especially with 3.5 and later
> versions which use redraws more often than in the past.
>
> --
> Ben Combee
> Veriprise Wireless <http://www.veriprise.com>
>
>
>
>



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