It's not one of those cases as long as you use the special FormGadgetTypeInCallback types which are not opaque.
Kevin -----Original Message----- From: James [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 24, 2002 11:33 AM To: Palm Developer Forum Subject: Re: II-How to Successfully Free Data from Gadget at Form Close? "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/ ------------------------------------------ The information in this transmittal and any attachments is privileged and confidential and is intended only for the recipient(s) listed above. You are hereby notified that any unauthorized distribution or copying of this transmittal or its attachments is prohibited. If you have received this transmittal in error, please notify Invivodata immediately at (831) 438-9550. ------------------------------------------ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
