Here's the code snippet. Obviously there's lots of other stuff going on,
but nothing that touches prefs. The interesting thing is that when I get
into the AppStop routine and look at OurInfo (which is the pref structure),
it has all the right stuff in it before the PrefSetAppPreferences call.
Then, when I restart the app and do the PrefGetAppPreferences, it returns
the right version number, but the prefs structure is all 0's.
Thanks in advance!
Mitch
static Err AppStart(void){
Int16 i;
... /* some unrelated code */
if((i = PrefGetAppPreferences(ourCreatorID, ourInfoID, &OurInfo,
&OurInfoSize, false)) == noPreferenceFound){
OurInfo.Preferences.PlayingRightHanded = true;
OurInfo.Preferences.DisplayStatsCount = false;
OurInfo.Preferences.DefaultTees = 2;
OurInfo.Preferences.DefaultNumberOfPlayers = 4;
OurInfoSize = PreferenceAndStateTypeSize;
PrefSetAppPreferences(ourCreatorID, ourInfoID, ProgramInfo.OurVersionNum,
&OurInfo, OurInfoSize, false);
}
else if(i != ProgramInfo.OurVersionNum)VersionUpdateMaybe(i);
return errNone;
}
static void AppStop(void){
OurInfoSize = PreferenceAndStateTypeSize;
PrefSetAppPreferences(ourCreatorID, ourInfoID, ProgramInfo.OurVersionNum,
&OurInfo, OurInfoSize, false);
/* Close all the open forms. */
FrmCloseAllForms();
/* Let the major objects do their own cleanup */
ClubCleanup();
RoundCleanup();
CloseGolferDatabase();
CloseRoundDatabase();
CloseShotDatabase();
return;
}
PS. I'm writing code after a very long hiatus. So, if this is some silly
"C" mistake I'm making, try not to hold it against me, I'm not as dumb as I
code ;-)
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/