I am new to C and to Palm programming.  I have the Palm manuals, and an
assortment of Palm Programming books, and an assortment of C books
(including K&R), but I must be looking in all the wrong places when it comes
to basic concepts that everyone else seems to take for granted.  Namely, how
to handle handles.

I know that handles enable the OS to allocate and reallocate memory more
effectively.  The handle is a non-moveable chunk holding the address of the
moveable and resizable chunk of memory.  But what if I have a pointer to the
memory, as in the case of a char pointer to a label returned from a
CtlGetLabel?  How do I get it's handle?

For example - I want to set the text of a Field from the label of a Control.
I could allocate additional memory and do a StrCopy, but wouldn't it be more
efficent to set the Field handle to the handle of the Control label?
CtlGetLabel gives me a char pointer to the label.  How do I (can I) coerce
that into it's handle?  If I do this, I assume that even though the Control
subsequently loses scope (the Control is on one form and the Field is on
another), if the handle is being used by the field (or a global), then the
memory holding the string will not be destroyed.

I know this is basic, but I seem to be missing a piece of the puzzle.  I
would appreciate some advice.  Is there a good text (preferably for the Palm
environment) that explains the basics of handles, without assuming that one
is already an proficient C programmer?

Thanks in advance -

Geoff Thompson
[EMAIL PROTECTED]



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to