Hi, I'm wrint a sub-routine to change a field's content, When I start my program, it
will display "field.c, Line:192, Text block size smaller than text", and I saw it
breaks at this line : oldTxtH = FldGetTextHandle(fldP);
any idea ?
FieldPtr SetFieldTextFromHandle(UInt16 fieldID, MemHandle txtH)
{
MemHandle oldTxtH;
FormPtr frm = FrmGetFormPtr(MainForm); // MainForm is 1000
FieldPtr fldP;
// get the field and the field's current text handle.
fldP = (FieldPtr)FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, fieldID));
ErrNonFatalDisplayIf(!fldP, "missing field");
oldTxtH = FldGetTextHandle(fldP);
// set the field's text to the new text.
FldSetTextHandle(fldP, txtH);
FldDrawField(fldP);
if (oldTxtH)
MemHandleFree((MemHandle)oldTxtH);
return fldP;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/