Umm...nothing obviously wrong.  But I don't think the code does what you said.

The two elements in ResultStruct seem not for string at all.  ResultID looks
like some type of integer and CurrentRec is initialized with a single '0' so
what you trying to write is only couples of bytes (8 maxmium possibably).

However the size issue itself doesn't warrant the error you saw.  They look
consistant.

What I can recommand is try to get the debugger working.  Step through the
lines and check all the values involved.  What development tool are you using? 
Both CodeWarrior and GCC have easy to use debuggers.

Max



--- l e s s <[EMAIL PROTECTED]> wrote:
......
>       if(dbRefResults!=0)
>               {
> 
>               ResultsStruct.ResultID = uIndex;
>               ResultsStruct.CurrentRec = 0;
> 
>               numRecordsResult = DmNumRecords(dbRefResults);
>               lengthRDB = sizeof(ResultsStruct.ResultID) +
>                               sizeof(ResultsStruct.CurrentRec) + 1;
> 
>               ResultsHand = DmNewRecord(dbRefResults, &numRecordsResult, lengthRDB);
>               insertRecResultsDb(ResultsHand,&ResultsStruct);
>                                                                       
>               }
> 
> and the instertRecResultsDb function:
> 
> void insertRecResultsDb(VoidHand ResultsHand,Results* ResultsStruct)
> {
>       UInt length = 0;
>       CharPtr s;
>       UInt offset = 0;
> 
>       length = sizeof(ResultsStruct->ResultID) +
> sizeof(ResultsStruct->CurrentRec);
> 
>       if(MemHandleResize(ResultsHand,length) == 0)
>       {
>               s = MemHandleLock(ResultsHand);
>               offset = 0;
> 
>               
>DmWrite(s,offset,&ResultsStruct->ResultID,sizeof(ResultsStruct->ResultID));
>               offset += sizeof(ResultsStruct->ResultID);
>       
>
DmWrite(s,offset,&ResultsStruct->CurrentRec,sizeof(ResultsStruct->CurrentRec));
> 
>               MemHandleUnlock(ResultsHand);
>       }
> }
> 
> 
> thanks...
> <crossing fingers>
> 
> 
> On Thu, 27 Dec 2001, Max Bian wrote:
> 
> > It is unclear what you are trying to do.  Are you dealing with selection in
> > field?  DmWriteCheck error happens when you pass something obviously wrong
> to
> > DmWrite function.
> > 
> > This should be a easy fix becuase the causes are limited.
> > Make sure you are passing correct parameters.  Correct means not only
> correct
> > type but correct values.  Things to check first:
> > + Is the database handle valid?
> > + Is the allocated size large enough?
> > + Is the offset and size correct?
> > + Is the source address correct?
> > 
> > Sometimes you believe they are correct, they may not.  Also check if the
> > parameters mean what you thought they mean.  Read the APIs carefully and
> look
> > into the comment section.
> > 
> > Use a source level debugger.  It tells you which line of code causing the
> > problem.
> > 
> > Usually, this type of error is the most easy one to fix.  If still unsure,
> post
> > the code that does the action.
> > 
> > Max
> > --- l e s s <[EMAIL PROTECTED]> wrote:
> > > 
> > > okie..my last attempt at getting to the bottom of my DmWriteCheck error..
> > > 
> > > does anyone know anything about what happens at the end of the screen in
> > > the palm..what makes it scroll over rather than wrap or whatnot. is there
> > > any special character that is inserted or is not inserted or needs to be
> > > inserted so that programs know there is more text offscreen. anything
> that
> > > might cause a problem when trying to read the lenght of the entire text
> > > spanning across more than one screen.
> > > 
> > > again im dealing with selections in a form that run offscreen and that
> > > cause a DmWriteCheck failed error when i submit the form (and the
> > > selections get written to records in a db)
> > > 
> > > im running outta ideas..so hopefully someone might be able to point me in
> > > the right direction...
> > > 
> > > thanks in advance!!!
> > > 
> > > 
> > > leslie
> > > 
> > > 
> > > 
> > > 
> > > -- 
> > > For information on using the Palm Developer Forums, or to unsubscribe,
> please
> > > see http://www.palmos.com/dev/tech/support/forums/
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Send your FREE holiday greetings online!
> > http://greetings.yahoo.com
> > 
> > -- 
> > For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
> > 
> 
> 
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe, please
> see http://www.palmos.com/dev/tech/support/forums/


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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

Reply via email to