My code goes somthing like this....

#define AppFileCreator    'test'
#define PreferenceID    0x00
#define Version    1
Char    somechar[25] = "";

static void SavePrefs()
{
    DBStruct    prefs;

    StrCopy(somechar, "SomePreferenceText");
    prefs.charpref = somechar;
    PrefSetAppPreferences(AppFileCreator, PreferenceID, Version, &prefs,
sizeof(DBStruct), true);
}

static void LoadPrefs()
{
    DBStruct    prefs;
    UInt16    prefSize;

    prefSize = sizeof(DBStruct);
    if (PrefGetAppPreferences(AppFileCreator, PreferenceID, &prefs,
&prefSize, true) != noPreferenceFound)
    {
        StrCopy(somechar, prefs.charpref);
    }
}

And all of this works fine while I'm running the program but when I exit and
come back everything is blank... but it doesn't give me a noPreferenceFound
error so I'm assuming it finds it but just doesn't return anything.....



"Dave Carrigan" <[EMAIL PROTECTED]> wrote in message
news:34572@palm-dev-forum...
>
> "Sam Trimble" <[EMAIL PROTECTED]> writes:
>
> > I have a question... does PrefGetAppPreferences work the way it is
suppose
> > to?
>
> Yes, why wouldn't it?
>
> > I've started doing some things with this and it's counterpart
> > PrefSetAppPreferences to save some preferences in my app.... and
everything
> > works great... until I exit the program. When I come back in all of my
Char
> > preferences are blank. Does anyone know anything about this or what I
can do
> > to get around it?
>
> Show us some code.
>
> --
> Dave Carrigan ([EMAIL PROTECTED])            | Yow! I love FRUIT PICKERS!!
> UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS |
> Seattle, WA, USA                            |
> http://www.rudedog.org/                     |



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

Reply via email to