Here is a piece of code which gets executed when removing a object that has a number of popup lists. These lists are dynamically created in that object's constructor function. Anyway, this FrmRemoveObject crashes in some specific situations. I know it's impossible to tell what's going on without looking at the codes, but still I wonder if anybody can guess what could possibly cause this problem. FYI,

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/

Reply via email to