Just found that the problem goes away if I uncheck the "Has Scroll Bar"
option in the constructor.
"Al Macy" <[EMAIL PROTECTED]> wrote in message
news:11850@palm-dev-forum...
>
> In a simple form, I set the text of a field as in the code below. On the
> emulator, if I enter "abc" into that field and then press backspace, I get
> the error message "...has just read from low memory". There are no other
> bad effects, and it only happens once. From then on, unless I exit my
> application and restart it, the problem does not recur.
>
> I've ignored this problem for years, partly because it used to happen even
> in the find dialog. But now I'd like to solve it. Does anyone see what's
> wrong? Thanks!
>
> (POSE 3.0a4, Palm OS 3.0).
>
> void SetFieldText( FormPtr formP, Word fieldID, CharPtr strP, BOOL
bDrawIt )
> {
> Handle oldTxtH;
> Handle txtH;
> CharPtr txtP;
>
> FieldPtr fldP;
> Boolean fieldWasEditable;
>
>
> // get some space in which to stash the string.
>
> txtH = (Handle) MemHandleNew( StrLen( strP ) + 1 );
> txtP = (CharPtr) MemHandleLock( txtH );
>
>
> // copy the string.
>
> StrCopy( txtP, strP );
>
>
> // unlock the string handle.
>
> MemHandleUnlock( txtH );
> txtP = 0;
>
>
> // get the field and the field's current text handle.
>
> fldP = GetFieldPointer( formP, fieldID );
> oldTxtH = FldGetTextHandle( fldP );
>
>
> // set the field's text to the new text.
>
> fieldWasEditable = fldP->attr.editable;
> fldP->attr.editable = true;
>
> FldSetTextHandle( fldP, txtH );
> if (bDrawIt)
> FldDrawField( fldP );
>
> fldP->attr.editable = fieldWasEditable;
>
>
> // free the handle AFTER we call FldSetTextHandle().
>
> if ( oldTxtH != NULL )
> MemHandleFree( oldTxtH );
>
> }
>
>
>
>
>
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/