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...


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

Reply via email to