Thanks for the debug code.  I used it on all my DmWrite's and was very
bewildered to realize the problem was before I even got to the writes.

I used  
FrmCustomAlert(DebugAlert, theMessage1, theMessage2, "");
to track the offending line.  As it turns out it was:
FldInsert(pField, (Char *)&pExtendedData[0], extendedDataLength);

I remarked out all references to pField and replaced the line with:
SetFieldText( CountItemNumVarField, (Char *)&pExtendedData[0], 17,
true );

This seems to have taken care of the problem.
I can not make the connection between the FldInsert and the
"DmWrite:DmWriteCheck failed" errors.

Thanks for your help.

Steve.


On Wed, 29 Jun 2005 13:21:49 -0400, "LionScribe"
<[EMAIL PROTECTED]> wrote:

>DmWrite calls DmWriteCheck internally before it writes. If it gets an error, 
>they return the message you received. Therefore in your release version 
>there is no reason to call DmWriteCheck;
>
>What you should do is, for debugging purposes, add your own DmWriteCheck 
>with an error message, so you should know exactly where and why the error is 
>happening.
>
>For example:
>
>#define DebugWriteCheck 1
>
>#ifdef DebugWriteCheck
> err = DmWriteCheck (recordP, offset, bytes);
> if (err)
> {
>  const char * errorType;
>  char errorStr[84];
>
>  switch (err)
>  {
>   case (dmErrWriteOutOfBounds):
>    errorType = "dmErrNotValidRecord";
>    break;
>   case (dmErrWriteOutOfBounds):
>    errorType = "dmErrNotValidRecord";
>    break;
>   default:
>    errorType = "UnknownError";
>  }
>  StrPrintF(errorStr, DmWriteCheck caused ErrorType %s:0x%x, errorType, 
>err);
>  ErrFatalDisplay(err, errorStr);
> }
>#endif
>err = DmWrite (recordP, offset, srcP, bytes);
>
>You can even add more info in the error message. Let me know if this helps.
>
>LionScribe
>
>
>"Robert Moynihan" <[EMAIL PROTECTED]> wrote in message 
>news:[EMAIL PROTECTED]
>> Steve Ely wrote:
>>
>>>Bob,
>>>
>>>Thanks for the insight.  I did manage to get a customer to fax me a
>>>set of barcodes that will reproduce the problem, so that is a big step
>>>in the right direction.
>>>
>> Yes, that will be a big help for you.
>>
>>>The fatal alert message is:
>>>
>>>DataMgr.c, Line:7025,
>>>DmWrite:DmWriteCheck failed
>>>
>>>What is the signifigance of Line:7025?
>>>
>> That really will mean nothing to you, same as it doesn't really mean 
>> anything to me.  If you had access to the source code for DataMgr.c then 
>> you could look up that line and see what was likely going on, but from the 
>> evidence at hand it really just means that one of your calls to a Dm.... 
>> function caused the crash.
>>
>>>Is it necessary or 'good practice' to call DMWriteCheck before any
>>>DmWrite?
>>>
>> I would have to say "no".  It is certainly not necessary, as what you 
>> really need in the first place is a good understanding of what you are 
>> writing and to where.  With that knowledge, you will be able to manage 
>> your writes so that you don't overflow the bounds.  As to whether or not 
>> it is good practice.... I just did a scan of my entire SDK 40 Example code 
>> folder, which contains the source code for the default apps -- 
>> Datebook, Mail, Memo, Reptiods, etc., and not a single DmWriteCheck() 
>> showed up.  I'm sure there are hundreds (or maybe thousands) of DmWrite() 
>> calls.  So, event if it IS good practice, it's not something that the Palm 
>> developers were doing.
>>
>> Bob
>> 
>
>
>


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

Reply via email to