James Lewis <[EMAIL PROTECTED]> writes: > I am responsible for maintaining code someone else > created, and we are in the process of modifying some > of the application preferences stored(adding more). > The intention is that we add some additional > preferences, and after the user has synched the > handheld device to install the upgraded version, it > should check upon startup whether the new preferences > can be retrieved from the system. So, I first call > PrefGetAppPreferences and retrieve the size of the > preferences block, then call it again with the > appropriate size preferences structure to retrieve the > actual preferences, whether we need to use the old > preferences structure or the new one with additional > fields. > > This seems like the correct thing to do, and works > very well in the emulator. However, it doesn't work > well at all on the actual Palm IIIx(OS version 3.1.1), > where it always seems to say the preferences block is > the new size, and loads the preferences with garbage > for the new fields. > > Any help or insight would be appreciated,
PrefGetAppPreferences() returns the version of the preferences that was defined when the prefs were set with PrefSetAppPreferences(). Each time you change a prefs structure, you should start passing a newer version number to PrefSetAppPreferences(). Then, when you get the prefs, you examine the version number that is returned and decide if you need to migrate the structure. -- Dave Carrigan ([EMAIL PROTECTED]) | Yow! Where's th' DAFFY DUCK UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | EXHIBIT?? Seattle, WA, USA | http://www.rudedog.org/ | -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
