Yep. The first parameter must be a pointer to the beginning of a valid
locked chunk. Use the offset to increment.

Matt

----- Original Message -----
From: "Dan Dorton" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 12:56 PM
Subject: Re: DmWriteCheck failed during DmWrite


I had a thought.  The first parameter in DmWrite (void *recordP), does this
have to be a pointer to the very beginning of the locked chunk?   In one of
the packed record functions, I am actually incrementing this pointer for
each sub-object.

I tried copying the source code for DmWrite and DmWriteCheck into my code
and calling them so I could walk through them.  On the times it is failing,
(when I am incrementing the pointer) the size and offset members of the
MemChunkHeaderType struct (that is populated in the DmWriteCheck function)
are way off.  Size is 64,000 something and offset is 84,000 something.

TIA,

-  Dan  :D

>>> Matt Hebley<[EMAIL PROTECTED]> 05/20/02 09:02AM >>>

From: Matt Hebley<[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 9:02 AM
To: [EMAIL PROTECTED]
Subject: Re: DmWriteCheck failed during DmWrite
Priority: Normal

This helps me even less. Now you appear to be using zero instead of offset
which used to be non-zero. In future you should try to resist modifying your
code when posting it, just post the relevant functions complete.

The best thing for you to do is to manually figure out exactly how big your
record should be for a given list of objects. Then watch which bytes you are
writing to in the record using a debugger. In CW, use "view as memory" on
the pointer to your record. You will see which bytes you are writing to, and
exactly when you try to write outside the record.

Matt

----- Original Message -----
From: "Dan Dorton" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 6:49 AM
Subject: Re: DmWriteCheck failed during DmWrite


The header contains information such as the number of sub-objects, size
etc...  As the list is walked these values are calculated, and then the
header is written at the end of the function.

Header.TotalSize = offset;
DmWrite(pDest, 0 /*offset*/, &Header, sizeof(Header));

return Header.TotalSize;

I suppose I could figure out these values before I started writing, but why
do it twice?

-  Dan  :D



--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to