At 08:56 AM 4/21/2004, you wrote:
>You cannot store handle or memory pointer on app pref
>because the system free all handles/memory blocks when you exit your app
>you need to store this in another way in a database for example as records.

Yes, the system will free all handles/memory unless you set the system as the owner. To do that call:
MemHandleSetOwner(myAppPrefs.itemStrings1, 0);
This will ensure that your handle isn't freed at app exit.

Unless you are running on Palm OS Cobalt -- your handle will be freed on exit there. It is much better to copy your data into a second pref or into a feature than to try to make normal MemHandles persistent.


-- Ben Combee, senior DTS engineer, PalmSource, Inc.
   Read "Combee on Palm OS" at http://palmos.combee.net/


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

Reply via email to