Michael,
I initially thought the same thing but this is more precisely what I'm
doing:
typedef struct { ... } v1_PreferenceType; // global, 142 bytes total
typedef struct { ... } v2_PreferenceType; // global, 228 bytes total
In AppStart()...
Word prefsSize, s=0;
prefsSize = PrefGetAppPreferences(CRID,APPPREFID,NULL,&s,true);
StrIToA(str1,prefsSize);
StrIToA(str2,sizeof(v1_PreferenceType));
StrIToA(str3,sizeof(v2_PreferenceType));
FrmCustomAlert(DebugAlert,str1,str2,str3); // shows a simple alert dialog
The resulting display shows the three sizes to be 2, 142, and 228.
Thanks for your suggestion,
Marty
----- Original Message -----
From: Michael S. Davis <[EMAIL PROTECTED]>
To: Palm Developer Forum <[EMAIL PROTECTED]>
Sent: Tuesday, April 18, 2000 12:40 PM
Subject: Re: PrefGetAppPreferences() question
>
> Just a guess but 2 sounds like you might have done something like
> sizeof() on your size variable. The size of the pointer
> variable might be 2; don't know what you are using.
>
>
> On Tue, 18 Apr 2000, Marty Rice wrote:
>
> > Hi,
> >
> > I'm trying to implement an upgrade to a program where the new version
has
> > more data in the preferences structure than the previous version. I've
got
> > both structures in the new program; the original is 142 bytes, the new
one
> > is 228 bytes. In my AppStart() function I am calling
PrefGetAppPreferences,
> > first with a NULL pointer to the structure and a value of "zero" for the
> > structure size, and then I look at the return value to determine which
> > version of the preferences is stored on the device. Make sense so far?
I
> > had planned to perform a second call to PrefGetAppPreferences() to write
the
> > stored preferences into the proper structure (v1 or v2). I then wrote a
> > function to "upgrade" the v1 preferences to the v2 structure. But I'm
not
> > getting that far.
> >
> > The problem is that the returned value corresponds to neither version of
the
> > preferences - it returns a value of 2 instead of the expected values 142
or
> > 228.
> >
> > Any ideas what I might be doing wrong?
> >
> > TIA!
> > -Marty
> >
> >
> >
> >
> > --
> > For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
> >
> >
>
> ----------------------------------------------------
> Shoot-to-Win
>
> Protect the 2nd Amendment
> ----------------------------------------------------
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html