Are you trying to set a Label or a Field??
For Label, use FrmCopyLabel - The best! Very easy to use and no hassle.
For Field, here is a little sample of how I set a 1 or 2 in a Field:
Handle txtH;
txtH = FldGetTextHandle(FrmGetObjectPtr(frmP,
FrmGetObjectIndex(frmP, 1204)));
if (txtH == NULL) {
txtH = MemHandleNew(2);
} else if (MemHandleResize(txtH, 2) != 0) {
MemHandleFree(txtH);
txtH = MemHandleNew(2);
} //IF
StrCopy((char *)MemHandleLock(txtH), "1\0");
MemHandleUnlock(txtH);
FldSetTextHandle(FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP,
1204)), txtH);
FldDrawField(FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, 1204)));
Hope this helps!
Eric Sun
Developer - RAD systems
Q. Data Inc.
4/26/00 10:22 AM
-----Original Message-----
From: Magnus Drougge [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, April 26, 2000 3:44 AM
To: Palm Developer Forum
Subject: RE: Setting the text of a label
I recall reading somewhere that you can 'legally' fetch the pointer
to the
label's textfield (the char array...) and copy whatever you want in
to it.
The drawback of doing this is that you can't exceed the size of the
string
set at compile time. Anyway, I tried it a few months ago and it
worked.
Can't provide you with an example though. :/
If this was covered in the thread below then I apologize.
/Drougge
==============================================
Magnus Drougge
Wireless Independent Provider AB
+46-455-339809, +46-708-319109
==============================================
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Dave
Lippincott
Sent: den 25 april 2000 18:44
To: Palm Developer Forum
Subject: Re: Setting the text of a label
Take a look at the thread: "need help using CtlSetLabel()"
In short, a label is not a field nor a regular control.
-----Original Message-----
From: Brian Bissell <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: Palm Developer Forum <[EMAIL PROTECTED]>
Date: Tuesday, April 25, 2000 12:00 PM
Subject: Setting the text of a label
>Has anyone successfully dynamically changed the text of a label
field? I
>have been trying the examples in the documentation using
FldSetTextHandle
>and the corresponding Ptr functions and cant get any of them to
work. It
>always throws memory errors when trying to set the text.
>
>
>
>
>
>--
>For information on using the Palm Developer Forums, or to
unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
>
>
--
For information on using the Palm Developer Forums, or to
unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to
unsubscribe, please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html