frmP = FrmGetFormPtr (MainForm);
for (i = 0; i < TOTAL_LISTS; i++) {
lstId = popupLists[i].lstId;
objId = FrmGetObjectIndex (frmP, lstId);
FrmRemoveObject (&frmP, objId); //CRASHES HERE
ctlId = popupLists[i].ctlId;
objId = FrmGetObjectIndex (frmP, ctlId);
FrmRemoveObject (&frmP, objId);
}Thanks, Jenni
Just in case you are curious about the construction process, here is a portion of the constructor function where I am creating the object (there mightbe some typo errors):
lastRsrcId = 2000;
for (i = 0; i < TOTAL_LISTS; i++) {
if (!CtlNewControl ((void**)&frmP, ++lastRsrcId,
popupTriggerCtl, NULL, // control type, textP
0, 0, maxWidth, 0, // x, y, width, height
stdFont, NULL, true) { // font, group, leftAnchor
ErrDisplay ("Memory ERROR!");
return;
}
popupLists[i].ctlId = lastRsrcId;
if (LstNewList ((void**)&frmP, ++lastRsrcId,
0, 0, maxWidth, 0, stdFont, 3, // x, y, width, height, font, visibleItems
popupLists[i].popupBox[popupBox].ctlId)) { // triggerId
ErrDisplay ("Memory ERROR!");
return;
}
popupLists[i].lstId = lastRsrcId;
}
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
