Hi,

I would like to get date book preferences in my application.
I am using following (at the end of this mail) code.
This code works fine in devices with Palm OS Version <= 5.2.
When I use a device with Palm OS Version = 5.4,
PrefGetAppPreferences API always returns noPreferenceFound.
What could be the reason ?

I tried to get the size of DatebookPreferenceType structure
using following code.

prefsSize = 0;
Int16 prefsVersion = PrefGetAppPreferences( sysFileCDatebook, datebookPrefID,
NULL, &prefsSize, true );

This method is mentioned in Palm OS API reference.
I am always getting prefsVersion = -1 and prefsSize = 0.

Could you please help me ?

Thanks,

Rajesh T R
Fischer Systems India Pvt. Ltd.
224, NILA, Technopark
Trivandrum-695581
INDIA
Ph:  91-471-2527120
Fax: 91-471-2527437
Mobile: 91-94473-87352
email: [EMAIL PROTECTED]
Web: www.fisc.com
______________________________________________________________________________
#define sysFileCDatebooks 'date'
#define datebookPrefID 0x00
#define noPreferenceFound -1
#define defaultDayStartHour 8
#define defaultDayEndHour 18

typedef struct
{
        UInt16  dayStartHour;
        UInt16 dayEndHour;
        AlarmInfoType   alarmPreset;
        FontID  v20NoteFont;            // Changed for 2.0 compatibility (BGT)
        Boolean saveBackup;
        Boolean showTimeBars;
        Boolean compressDayView;
        Boolean showTimedAppts;
        Boolean showUntimedAppts;
        Boolean showDailyRepeatingAppts;
        UInt8 reserved;

        // Version 3 preferences
        UInt16  alarmSoundRepeatCount;
        UInt16  alarmSoundRepeatInterval;
        UInt32  alarmSoundUniqueRecID;
        FontID  apptDescFont;
        FontID  noteFont;               // Changed for 2.0 compatibility (BGT)

        // Version 4 preferences
        UInt16  alarmSnooze;
} DatebookPreferenceType;

DatebookPreferenceType prefsP;
UInt16  prefsSize = sizeof( DatebookPreferenceType );
Int16 prefsVersion = PrefGetAppPreferences( sysFileCDatebook, datebookPrefID,
&prefsP, &prefsSize, true );
UInt16 m_prefDayStartHour = defaultDayStartHour;
UInt16 m_prefDayEndHour = defaultDayEndHour;
if( prefsVersion != noPreferenceFound )
{
        m_prefDayStartHour = prefsP.dayStartHour;
        m_prefDayEndHour = prefsP.dayEndHour;
}
______________________________________________________________________________



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

Reply via email to