>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. -Jon -------------------------------------------- Jonathan Hays Palm OS Certified Developer http://hazelware.luggle.com -------------------------------------------- ----- Original Message ----- From: "Pit" <[EMAIL PROTECTED]> Newsgroups: palm-dev-forum To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 2:46 PM Subject: Can i store a handle in the application preferences block. > Hi, > > i have a MemHandle in a struct which holds a char**, which stores multipe > strings. > > When the application is exited, i want to store the struct in the > application preferences block. > After starting the application again, i want to get the stored struct out > of the application preferences block. > > The problem is, when i call MemHandleLock(itemStrings1), i get a > MemHandleFree error. > Is the handle not stored correctly, or what is here the problem? > > Best Regards > Peter > > Enclosed you will find the code snip: > > typedef struct { > int kundennummer; > MemHandle itemStrings1; > } AppPrefs; > AppPrefs myAppPrefs; > > > Exit Application: > PrefSetAppPreferences (CREATORID, 0, 0, &myAppPrefs, sizeof (AppPrefs), > false); > > Start Application: > UInt16 size = sizeof (AppPrefs); > PrefGetAppPreferences (CREATORID, 0, &myAppPrefs, &size, false); > > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
