"DeVon Fowler" <[EMAIL PROTECTED]> wrote in message
news:102454@palm-dev-forum...
>
> More clearly stated:
> At form close the extended gadget receives a callback
> message with a cmd value of formGadgetDeleteCmd. To
> delete the gadget data a call to FrmGetGadgetData() is
> required to retrieve the memory pointer that is to be
> freed using MemPtrFree(). To accomplish this, a
> pointer to the form containing the gadget must be
> obtained.
Your gadget callback is passed a pointer to the gadget itself, and you can
access the gadget's data through this pointer. (If you're worried about
PalmSource's restrictions about not accessing the internals of structs
directly, don't worry, this isn't one of those cases.)
You shouldn't need a pointer to the Form.
Something like this should work in your callback handler:
case formGadgetDeleteCmd :
if (gadgetP->data != NULL)
{
MemPtrFree(gadgetP->data);
}
break;
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/