Any advice on tracking down this error? I must be overwriting some memory
somewhere, but I can't seem to find the problem. When I debug the app,
inside the FrmDoDialog() call, pFrm2 gets set to pFrm. It happens after
about 25 calls to this function.
TIA for the help,
Eric Martens
--- Suspect Code Below---
static void
InputDataDialog(CharPtr pData)
{
// Save Current form and call dialog...
FormPtr pFrm2 = FrmGetActiveForm();
FormPtr pFrm = FrmInitForm(InputDataForm);
FrmSetActiveForm(pFrm);
FrmSetFocus(pFrm, FrmGetObjectIndex(pFrm, InputDataFieldDataField));
if (FrmDoDialog(pFrm) == InputDataOKButton) // <-- Problem happens here
// removed to rule out as culprit...
GetFieldText(InputDataFieldDataField, pData); // Read the User Input
// Return to original form
FrmSetActiveForm(pFrm2);
FrmDeleteForm(pFrm);
}
static Boolean
VerifyFormHandleEvent(EventPtr eventP)
{
Boolean handled = false;
FormPtr pFrm;
pFrm = (FormType*)MemPtrNew(sizeof(FormType));
ControlPtr ctl;
ctl = (ControlType*)MemPtrNew(sizeof(ControlType));
EventType event2Queue;
pData = (CharPtr)MemPtrNew(MAX_STR_SZ);
switch (eventP->eType)
{
case ctlSelectEvent:
switch (eventP->data.ctlEnter.controlID)
{
case FeederVerification_VerifyLineIDButton: // Gets Data from
InputDataForm
ctl = (ControlPtr)GetObjectPtr
(FeederVerification_VerifyPup_LineIDPopTrigger);
if (StrLen(CtlGetLabel(ctl)) < MAX_STR_SZ)
StrCopy( pData, CtlGetLabel(ctl) );
InputDataDialog(pData); // See above
// removed to rule out as culprit...
VerifyFormUpdate(FeederVerification_VerifyLstLineIDList, pData);
// Update Popup Trigger Text
CtlSetLabel(ctl, pData);
}
handled = false;
break;
}
return handled;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/