I keep stubbing my toe on the MemHandle vs. MemPtr issue, and I can't seem
to find any documentation that really does a good job of explaining how they
work, and work together. (If anyone knows of some good reading on the
subject, I'd love to know about it.)
My specific question has to do with the data that a gadget can store. I know
it stores a pointer to something (anything), but in the function
FrmSetGadgetData, can the argument that represents the pointer to the data
be a *handle* to the data instead of a pointer?
I know a handle is a moveable chunk of memory and a pointer is a nonmoveable
chunk. I know that to read or write to a chunk, you have to make it
nonmoveable (either by declaring it as a pointer right off the bat, or by
declaring it as a handle, then locking the handle, which returns a pointer -
right?). But can you use a handle instead of a pointer as an argument to
some functions? Like FrmSetGadgetData, in particular?
Finally, how important is it to use handles instead of pointers in the first
place? When my app is running, why does the OS need to be moving memory
around anyway? Or is it that idea that, while my app is running, if it's
possible to start another app, THAT's when the OS might want to move the
memory? I mean, if I use pointers instead of handles for the gadgets on a
form, but they're around only as long as the form itself is around, is this
a big deal?
Thanks so much for any input - this has caused me more grief than all other
issues combined...
Brian
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/