You shouldn't be calling FrmGotoForm on your frmCloseEvent. When your form
receives frmCloseEvent, FrmGotoForm has usually already been called. Your
form is being told to close in response to FrmGotoForm, which closes the
current form and loads another form (see the Palm OS Reference for more
info). You should be calling FrmGotoForm somewhere else, probably on a
user-input event (like on a ctlSelectEvent, lstSelectEvent, etc). Try not
calling anything on frmCloseEvent in your code. This will probably
eliminate your problem.
In my experience, frmCloseEvent should be used for doing things like
deallocating memory allocated specifically for a form, or for saving
data/preferences when leaving a form. Calls to the Frm* Palm OS API really
shouldn't be in frmCloseEvent code.
Hope this helps,
-DGA
> Hi,
> I am having some trouble with closing a form. My form handler
> is calling
> FrmGotoForm(newFormPtr) on a frmCloseEvent and returns false, but the
> newForm is drawn on top of the previous form. So it looks like the
> previous form was not erased. Are there any situations where
> FrmHandleEvent would not automatrically erase and delete a form on a
> frmCloseEvent?
> Note, i also tried to erase and delete the form programatically and
> return false to FrmDispatchEvent but this causes the
> application to read
> an unallocated memory chunk (probably when trying to delete an already
> deleted form).
> I suspect I'm doing something wrong in the code or constructor but
> where? Any idea?
> Thanks,
> Massimo
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/