Hi David,
I am the one who posted on this subject on October 18th that Lance is
refereing to.
No one from PalmOne ever responded to this one. Like stated, I "fixed" my
issue by changing not to use the resize.
There error does happen on the close of the database, and it is one of the
PIM databases. I was just creating a Memo.
Below is what I originally posted. Perhaps someone from PalmOne can answer
why it is no longer any good.
Thanks,
Scott
---------------------------------------------------------------------------
I have a piece of code that copies some text to a buffer, then makes a memo
from the buffer.
This has worked in my product on every OS 5 device except the T3. On the
T3, I get the following error when calling
DmCloseDatabase(memoDB);
DataMgr.c, Line:7399, DmWrite: DmWriteCheck failed
Notice that it says DmWrite is writing this fatal alert. This is happening
when I call DmCloseDatabase. Looking at the DataMgr.c source, I cannot see
where DmCloseDatabase even calls DmWrite. Anyhow does anyone see anything
wrong with the code I have below that would cause the above to happen only
on the T3(and T3 simulator), and it happens when DmCloseDatabase is called.
Thanks,
Scott
DmOpenRef memoDB;
MemHandle hNew;
char *writebuf;
UInt16 numbytes;
UInt16 RecNum;
Char *theMemo;
Err err;
UInt32 tlong;
DateTimeType td;
#define MemoBufsize 1024
Char buf[40];
memoDB = DmOpenDatabaseByTypeCreator( 'DATA', 'memo',
dmModeReadWrite);
if (!memoDB) {
break;
}
writebuf = (char *) MemPtrNew(MemoBufsize);
if (!writebuf) {
FrmAlert(NoMemAlert);
DmCloseDatabase(memoDB);
break;
}
numbytes = 0;
// copy some stuff to the writebuf
hNew = DmNewRecord(memoDB, &RecNum, MemoBufsize);
if (!hNew) {
FrmAlert(NoMemAlert);
DmCloseDatabase(memoDB);
break;
}
theMemo = MemHandleLock(hNew);
DmStrCopy(theMemo, 0, writebuf);
err = MemHandleResize(hNew, numbytes);
MemHandleUnlock(hNew);
DmReleaseRecord(memoDB, RecNum, true);
err = DmCloseDatabase(memoDB);
MemPtrFree(writebuf);
}
break;
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/