rec->data = 10;
You are trying to write directly to storage area of RAM.
Use DmWrite() function.
-----Original Message-----
From: Johnathan Smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 3:51 PM
To: Palm Developer Forum
Subject: Saving to the database
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/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/