At 15:33 2002-12-1 -0800, you wrote:
The reason this gives an error is that the size of ControlType isn't known to your application, since ControlType is an internal structure and knowing the size of this requires knowing the representation of the internals.I'm trying to change the text repeatedly for various controls including pushButtonCtl and popupTriggerCtl. There were techniques for verifying that the text returned from CtlGetLabel() was the initial default value.This now generates warning or error messages in Palm OS5: freeTxtP = (char *)ctlP + sizeof(ControlType); oldTxtP = (char *)CtlGetLabel(ctlP); CtlSetLabel(ctlP, txtP); if(oldTxtP != freeTxtP) ... Does anyone know how this type of verification is performed in Palm OS5 without generating error or warning messages?
The only way to know if the label for a control was the label originally allocated by the system when the form was created is to record this info in the frmOpenEvent handler and compare at frmClose time. You could just go ahead and set a dynamic label always in the open handler and then just always free the text at close time -- that removes the need for the check, since there would always be a dynamically allocated string associated with the control.
--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
