After a HotSync, I am trying to have the databases in my app sorted.  I have a
function CompareRecordFunc that works as long as my app is running.  However
after a HotSync, the app isn't running and I receive a Fatal Error.  Below is
the code that is executed after a HotSync along with my database struct.  I know
this is something so completely obvious that I am missing, can someone provide a
pointer?

Thanks,

Edward Ross

//in palmmain()

case sysAppLaunchCmdSyncNotify:

   OpenOrCreateDatabase(kWorkDB_DBName, kDBType, kCreator, &sncWorkDB);

   error = DmInsertionSort(sncWorkDB, (DmComparF *) CompareRecordFunc , 0);

===

UInt16 CompareRecordFunc(skelWorkDBType *rec1, skelWorkDBType *rec2,
   UInt16 unusedInt, SortRecordInfoPtr unused1, SortRecordInfoPtr unused2) {
        UInt16   result;

        result = StrCaselessCompare(rec1->PUN, rec2->PUN);

        return result;
}

===

#define kWorkDB_DBName                        "WorkDB"
typedef struct {
        UInt32 Date;
        Char PUN[21];
} skelWorkDB;
typedef skelWorkDB    skelWorkDBType;
typedef skelWorkDB*   skelWorkDBPtr;


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

Reply via email to