I am seeing some strange results from the Emulator when I use
FldGetTextPtr. The following code snip shows this:
{
CharPtr fldVal;
Char saveVal[100];
fldVal = FldGetTextPtr(fieldP);
if(fldVal)
{
int len = StrLen(fldVal);
if(len < 100)
{
StrCopy(saveVal, fldVal);
DmWrite(recPtr, 0, fldVal, len);
}
}
}
When this runs, the Emulator reports an error on the DmWrite, saying
that I "have just read directly from memory manager data structures".
Why does it report this on the DmWrite but not on the StrLen or the
ScrCopy, both of which access the same fldVal. If I change the code to
use FldGetTextHandle and MemHandleLock instead of going straight to the
pointer with FldGetTextPtr, then it works fine, no complaints from the
emulator. Either way runs fine on the device.
Is this a bug in the emulator or maybe the OS, or am I missing
something?
Thanks,
-Gabe
Palm Creations