With Windows 98, CodeWarrior R6 using OS 3.5 support, Emulator 3.0a3, with either
color debugRom or color nondebugRom I get an error
when running the sample program Test35 which is included in the 3.5 SDK. Stepping
through with the debugger indicates it occurs on
the FrmRemoveObject line in the InitAPicker function below. The error message is
"Test3.5" 1.0 has just read directly from memory manager data structures.
If I click "continue" it all seems to run fine.
Since it is getting to the FrmRemoveObject line, it would seem that CodeWarrior R6 is
using an old PalmRez?
Any ideas about what is going on here?
Thanks.
Keith Wolcott
/***********************************************************************
*
* FUNCTION: InitAPicker
*
* DESCRIPTION: Initializes our gadgets
*
***********************************************************************/
static void InitAPicker(FormPtr *frmPP, UInt16 objID, UIColorTableEntries entry)
{
myChitType *dataP;
FormGadgetType *gadgetP;
RectangleType r;
FormGadgetAttrType attrs;
dataP = (myChitType*) MemPtrNew(sizeof(myChitType));
if (!dataP)
return;
dataP->colorindex = UIColorGetTableEntryIndex(entry);
dataP->UITableEntry = entry;
UIColorGetTableEntryRGB(entry, &dataP->rgb);
// is this really an extended gadget? If not, we must have been built
// using an old PalmRez, so remove and recreate the gadget at runtime.
// (Could call FrmGetObjectType here to check that it is a gadget, if you want.)
// Also note that both the form pointer and the object index could change
// in the process, so don't cache them.
gadgetP = (FormGadgetType *) FrmGetObjectPtr(*frmPP, FrmGetObjectIndex(*frmPP,
objID));
if (gadgetP->attr.isExtended == 0) {
// copy out the old settings, remove the old-style gadget, and create a new extended
one
r = gadgetP->rect;
attrs = gadgetP->attr;
FrmRemoveObject(frmPP, FrmGetObjectIndex(*frmPP, objID));
FrmNewGadget(frmPP, objID, r.topLeft.x, r.topLeft.y, r.extent.x, r.extent.y);
}
FrmSetGadgetData(*frmPP, FrmGetObjectIndex(*frmPP, objID), dataP);
FrmSetGadgetHandler(*frmPP, FrmGetObjectIndex(*frmPP, objID), &PickerGadgetHandler);
}
---
For information on using the Palm Developer Forums, or to unsubscribe, please see
<http://www.palm.com/devzone/mailinglists.html>.