At 12:47 PM 6/11/2004, you wrote:
Ben Combee wrote://The first time I need the preferences I do:
if(FtrGet(appFileCreator, 1, (UInt32 *)&prefs) != 0)
{
FtrPtrNew(appFileCreator, 1, 32, &newPrefs);
PrefGetAppPreferences(appFileCreator, (UInt16)0, &prefs, &prefsSize, true);
DmWrite(newPrefs, 0, &prefs, prefsSize);
}
//When I'm done PrefSetAppPreferences(appFileCreator, 0, 1, &prefs, sizeof(prefs), true);
Is that correct? Do I need to add a Dmwrite after that to save it?
You've verified that 32 bytes is sufficient to store your prefs structure in memory, right?
I got that out of both the Palm OS programming Bible and the Palm OS programmer's companion. I assumed it was just alocating enough to store the pointer to the prefs struct...
I'm not sure what you're doing. Are you storing a copy of the entire prefs structure in feature memory? That's what the code looks like to me. Storing a pointer to the prefs won't help, as either prefs is a global (and unavailable when globals aren't there) or its a DB record (and you have to ensure it's been locked down).
-- Ben Combee, DTS technical lead, 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/
