Hi All,
Is there anything wrong with this code? When I run this
using Codewarrior (I believe it's R6) and the Emulator (3.0a6, 3.3V
or 3.1V Debug ROM), the debugger activates during DmResizeRecord and
pops up a dialog box with some random characters in it. Is there
something wrong with my code or is there a problem with the
emulator/codewarrior/palm os? I've checked the knowledge base but I
didn't find anything on this.
theDataRef = DmOpenDatabaseByTypeCreator('pict', 'pTCP',
dmModeReadWrite | dmModeExclusive);
if(!theDataRef)
{
err = DmGetLastErr();
if(err && err != dmErrDatabaseOpen)
err = DmCreateDatabase(0, "test_pict",
'pTCP', 'pict', false);
err = 0;
theDataRef = DmOpenDatabaseByTypeCreator('pict',
'pTCP', dmModeReadWrite | dmModeExclusive);
if(!theDataRef)
{
err = DmGetLastErr();
ErrFatalDisplay("Database open/create error");
}
}
thePictHand = DmNewRecord(theDataRef, &theRecordIndex, theDataMaxSize);
ErrFatalDisplayIf(!thePictHand, "Error creating record");
thePictPtr = MemHandleLock(thePictHand);
while(theDataSize > 0)
{
theDataSize = NetLibDmReceive(AppNetRefnum, sock,
thePictPtr, theDataPos, 512, netIOFlagOutOfBand, NULL, NULL, 0, &err);
theDataPos = theDataPos + theDataSize;
if(theDataPos > theDataMaxSize)
{
theDataMaxSize = theDataMaxSize * 2;
MemHandleUnlock(thePictHand);
DmResizeRecord(thePictHand, theRecordIndex,
theDataMaxSize);
err = DmGetLastErr();
ErrFatalDisplayIf(!thePictHand, "Error
resizeing record");
thePictPtr = MemHandleLock(thePictHand);
}
}
MemHandleUnlock(thePictHand);
if(theDataMaxSize != theDataPos)
{
DmResizeRecord(thePictHand, theRecordIndex, theDataPos);
err = DmGetLastErr();
ErrFatalDisplayIf(!thePictHand, "Error resizeing record");
}
DmReleaseRecord(theDataRef, theRecordIndex, true);
DmCloseDatabase(theDataRef);
Thanks in advance,
-Mike
P.S. I posted this a while ago but got no response... Do I need to
put in more info??
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/