Under Palm OS 4.0, the following bit of code in the frmOpenEvent handler for
a form causes a list defined in a resource to display incorrectly:
case frmOpenEvent:
frmP = FrmGetActiveForm();
newFrmP = frmP;
ctlP = CtlNewControl (&newFrmP, 2000, buttonCtl, "X",
15, 15, 15, 15,
stdFont, 0, true);
FrmDrawForm ( newFrmP);
handled = true;
break;
The list contents start out with a correct first entry, but all subsequent
entries are garbage. In this particular case, I defined the list to have
One
Two
Three
as the entries, but it displays as
One
DrOne
e
If I compare the list items text pointer held in the form object before and
after the CtlNewControl call, it appears that the list items were moved, but
only the pointer to character in the _first_ array entry was updated:
Before - items array 0x43F8 -> 0x4404
-> 0x4408
-> 0x440C
After - items array 0x43FE -> 0x440A
-> 0x4408
-> 0x440C
Is this a known bug?
Mark Peters
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/