Hi,all!
I make the codes below, I want to insert a new record into a database.
But the simulator just stopped at the last line of this routine. At this 
moment, if I step over or force run,
the simulator will crash.
Could anyone help me about this?


void DBNewRecord(DmOpenRef db, DBRecord *record, UInt16 *indexP)
{
        UInt16 index;
        MemHandle newRecordH;
        DBRecord *newRecordP;
        index = DmFindSortPosition(db, &record, NULL,
                (DmComparF *) CompareDBRecords, NULL);
        newRecordH = DmNewRecord(db, &index, GetRecordSize(record));
        newRecordP = MemHandleLock(newRecordH);
        DmWrite(newRecordP, 0, &record, GetRecordSize(record));
        MemHandleUnlock(newRecordH);
        DmReleaseRecord(db, index, true);
        *indexP =index ;
        DmCloseDatabase(gLibDB);
}


Best regards,
Chrix


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

Reply via email to