I'm dealing with a selection in the field of a form...upon submission the
fields are written to records in a datbase...
for regualr selections that fit into the screen...i get no problems.
but when i submit with selections that go off the screen that's where the
trouble starts.
ive been posting messages about this error (DmWriteCheck failed error and
DmWrite or DmWriteCheck? etc) and i posted the code too and the consensus
was that the record probably not large enough although no one could see
anything that was wrong with the code. thats why i was thinking..the value
of the lenght i am using to pass into the function might be wrong (what
you said about being correct with both the type and value)...and that
length might be wrong because it is having some sort of problem reading
text offscreen. so with that being said, does anyone know anything about
that? or is this some new limitation within PalmOS that no one's ever
seen before..??
i also cannot seem to get the debugger working at all even though many ppl
posted helpful messages about getting that set up too..so this supposedly
easy error to fix has become a very hard one for me :(
leslie
p.s. last ditch effort...here is the code again in case you see anything
new:
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/