[EMAIL PROTECTED] wrote:

In fact it is not normal and tht's why I have a problem. I must be blind !!!
Thanks
Just another example of how hard it is to proofread your own code. One other comment that I would have it that you don't test the return values to make sure that they are valid before using them. You'll run into touble, at some point, if you don't. I edited your code (below) so that it would avoid crashing if those calls failed. You might also consider adding error messages so that the user knows what happened when expected new records don't show up.

DmCreateDatabase (0, "cmlgaumontstatdb", 'CEDM', 'DATA', false);
DBId = DmFindDatabase (0, "cmlgaumontdb");
if (DBId){
        DBOpenRef = DmOpenDatabase (0, DBId, dmModeReadWrite);
        if (DBOpenRef){
                index = DmNumRecords (DBOpenRef);
                pNewRecord = DmNewRecord (DBOpenRef, &index, iRecordLength);
                if (pNewRecord){        
                        pRecord = MemHandleLock (pNewRecord);
                        DmWrite (pRecord, 0, pRecordContent, iRecordLength);
                        MemPtrUnlock (pRecord);
                        DmReleaseRecord (DBOpenRef, index, false);
                }
        }
}

--

Bob

www.rmobile.ca
--------------
Mobile software for handheld computers and smartphones


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

Reply via email to