Hello,
What is the proper way to change the label of a control? When using POSE
I get a error that I am reading from an unlocked memory chunk.
What I have is a Selector Trigger and I am changing the label to the current
date. Can anyone look at my code and give me any suggestions?
Any help would be appreciated,
Jay
Code:
static void MainFormInit(FormPtr frmP)
{
CharPtr pStrDate;
VoidHand textH;
/* a Control pointer to the object*/
ControlPtr btn;
btn =
(ControlPtr)FrmGetObjectPtr(frmP,FrmGetObjectIndex(frmP,MainSelTrigger));
/* allocate memory for the new label */
textH = MemHandleNew(DATE_FIELD_SIZE);
pStrDate = (char*)MemHandleLock(textH);
DateToAscii(month,day,year,dfMDYWithSlashes,pStrDate);
CtlSetLabel(btn,pStrDate);
MemHandleUnlock(textH);
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/