Can someone please look at my sample and tell me why I
am getting memory errors

struct MyRecord {
    UInt16 data;
};



static void saveRec()
{
        DmOpenRef dbRef;
    
        dbRef = OpenRecordDatabase(DBNAME, CREATORID,
DBTYPE);
        
        UInt16 at = dmMaxRecordIndex;
        MemHandle h = DmNewRecord( dbRef, &at, sizeof(
MyRecord ) );
        MyRecord *rec = (MyRecord *) MemHandleLock( h );
        
        rec->data = 10;
        
        DmSet( rec, 0, sizeof( *rec ), 0 );
        MemHandleUnlock( h );
        DmReleaseRecord( dbRef, at, true );

}


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

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

Reply via email to