I have been following all the emails on this and I have done the same as in
the email and I still am writing to low mem.
I know the DB is created so that is not the problem. I know it works fine
all the way down to DmWrite. Anyone that could shed some light on this, the
help would be greatly appreciated. Ok new question as I run for the 100th
time studying the code. It seems to run once, it should be able to run 10
time storing 10 times in the db right? Well it seems to me like the error
comes after it has be run once. Why would the code not work more then once?
this is the error when it is run more then one time.
the error is app just read from memory location 0x00000006, which is in low
memory.
then when I continue the error
"SysFatalAlert with message: "memoryMgr.c,line 4365,NULL handle"
Line 4365 takes me to the end of PilotMain
case ctlSelectEvent:
if (event->data.ctlEnter.controlID == MainSaveButton)
{
struct MyRecord{
UInt16 data;
};
DmOpenRef dbRef;
UInt mode;
mode = dmModeReadWrite;
dbRef=DmOpenDatabaseByTypeCreator(DBTYPE, CREATORID, mode);
UInt16 at= dmMaxRecordIndex;
MemHandle h = DmNewRecord(dbRef,&at,sizeof(MyRecord));
MyRecord *rec = (MyRecord*)MemHandleLock(h);
MyRecord TempRecord;
TempRecord.data = 10;
DmWrite(rec,0,&TempRecord,sizeof(TempRecord));
MemHandleUnlock(h);
DmReleaseRecord( dbRef, at, true );
}
Thank you for any help you might be able to offer.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/