> Here is the way that I'm getting the frmP.
>
> FormPtr frmP;
> UInt16 ObjIndex;
> ...
> frmP = FrmGetActiveForm();
> ObjIndex = FrmGetObjectIndex(frmP,ReviewLoadButton);
> FrmShowObject(frmP,ObjIndex);
The two questions that come to my mind concerning this code are:
1. Do you ever execute this code prior to doing FrmDrawForm() ? This may
not cause any problem since FrmShowObject() is only supposed to draw the
object if the form is visible, but I don't know if this is consistent across
different OS versions. It is possible (though I don't know) that it tries
to redraw the object and that would cause a crash if the form hasn't been
drawn yet.
2. Did you try checking the value of frmP before using it?
FrmGetObjectIndex() will crash if the form pointer is invalid. (It is a
common mistake to assume that FrmGetActiveForm() always returns the form you
last drew.)
Other than these two comments I don't see anything obviously wrong with the
code.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/