The memory allocated that you used in FldSetTextPtr must be valid for the
life of the edit field.  If your code snip is part of a function, as soon as
it returns, the memory for the variable 'test' will no point to a valid
location.

----- Original Message -----
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Saturday, April 28, 2001 2:23 AM
Subject: Field Problem.


> Hi All,
> I have my project in c++. I am trying to set text in a noneditable field.
> My code is as follows but it does not show me the text on screen what may
be
> the problem?
>
>
> Char* test;
> test = "MyText";
> FormPtr frm = FrmGetActiveForm();
> FieldPtr fldPtr = (FieldPtr) FrmGetObjectPtr(frm, FrmGetObjectIndex(frm,
> fieldId));
> FldSetTextPtr(fldPtr,test);
> FldDrawField(fldPtr);
>
> I do not know whether anything extra is to be done for c++.
>
> Regards,
> Kapil.
>
>
> --
> 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/

Reply via email to