Try the Preference Editor by Bodo Bellut to view/edit entries in saved and
unsaved preferences DB. They do get deleted when you delete the app as long
as the creator id of the pref database matches the creator id of your
application. I use the following code to see if a pref exists for my app,
where appFileCreator is a #define for my creator ID and AppPrefID is a
#define for the version of prefs. The version is not used yet.
'noPreferencefound ' is defined by the Palm API as the return code for no
preferences existing for the requested creator ID.

#define appFileCreator     'Abcd'
// Used to get preferences this is resource id
// Version num not used yet in GetPrefs
#define appPrefID                  0x00
#define appPrefVersionNum          0x01

prefsSize = sizeof(MyAppPrefType);
prefSizeret = PrefGetAppPreferences(appFileCreator, appPrefID, &prefs,
&prefsSize, true);
 if ( (prefSizeret != noPreferenceFound) )
  {
    // they were found
    // get from prefs structure
  }
  else {
      file://FrmCustomAlert(ErrorAlert, "No Prefs found or bad", NULL,
NULL);
      StrCopy(gUserName, GetSyncInfo() );
            if ( sysPrefs.country == cUnitedStates )
          gUserMileageUnit = mi;
  }

Here is the section from Palm API reference:

PrefGetAppPreferences
Purpose

Return a copy of an application's preferences. Sometimes, for variable
length resources, this routine is called twice:


Once with a NULL pointer and size of zero to find out how many bytes need to
be read.


A second time with an allocated buffer allocated of the correct size. Note
that the application should always check that the return value is greater
than or equal to prefsSize.

Prototype
SWord PrefGetAppPreferences (DWord creator, Word id, VoidPtr prefs, Word
*prefsSize, Boolean saved)
Parameters
   creator
 Application creator.

   id
 ID number (lets an application have multiple preferences).

   prefs
 Pointer to a buffer to hold preferences.

   prefsSize
 Pointer to size the buffer passed.

   saved
 If true, retrieve the saved preferences. If false, retrieve the current
preferences.


Result

Returns the constant noPreferenceFound if the preference resource wasn't
found.

If the preference resource was found, the application should check that the
value in prefsSize is equal or less than the return value. If it's greater
than the size passed, then some bytes were not retrieved.

Hope this helps....


Marty Rice <[EMAIL PROTECTED]> wrote in message news:504@palm-dev-forum...
>
> When are application preferences "deleted"?  I assumed that
> if you delete the app from the device, the application preferences
> are also deleted.  But after re-installing my application and then
> calling PrefGetAppPreferences, they seem to be still there.  I
> have tried this using POSE as well as an actual device (thinking
> the HotSync would delete them).  Somebody please enlighten
> me.
>
> TIA,
> Marty
>
>
>







-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to