If the handle is returned by Data Manager then you are correct that you do not 
free it. Data Manager looks after these handles itself. However, you still must 
lock any handle returned by Data Manager before you use it and then unlock it 
afterward. 

Locking the handle, of course, gives you a pointer to the handle's data. You 
can unlock the handle later with MemPtrUnlock. In this scenario, make sure that 
it is indeed MemPtrUnlock that you are calling and not MemPtrFree. Furthermore, 
be careful that it is the pointer that you provide in the MemPtrUnlock call, 
not the handle.

Lastly, note that the functions that I indicate have "Ptr" in their names, not 
"Handle". When I first started programming in this stuff, I would mix up 
MemPtrFree and MemHandleFree. (not that I would ever admit that)
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to