On 10/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I'm writing a background application which listens for field input in other apps and then 
edits the field. The following code gives an "Invalid Field Length" error after 
calling FldDrawField(). Am I doing anything wrong?

FieldType* fldP = field ptr
Char* fullString = null terminated string...
MemHandle newTextH = FldGetTextHandle(fldP);
MemHandleResize(newTextH, StrLen(fullString) + 1);
Char* newText = (Char*)MemHandleLock(newTextH);
DmStrCopy(newText, 0, fullString);
MemHandleUnlock(newTextH);
FldDrawField(fldP);

After you resize the handle and put in new text, you need to call
FldRecalculateField to fix the field's internal tables for the new
content.

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

Reply via email to