Hi Oscar
> but the program still crash everytime when I run the "FrmNewGadge( )"
> function, do you know why?
are you sure, that frmP is a valid form pointer for the displayed form?
btw: is there any special reason why you use NewPtr instead of frmP?
I tried the following lines, and they worked fine:
#define GadgetID 3001 // unique ID nr
[...]
FormType *frmP;
FormGadgetType *gadgetP;
[...]
case TestBtn:
frmP = FrmGetActiveForm();
gadgetP = FrmNewGadget( (FormType **) &frmP, GadgetID, 50, 50, 20, 20);
if (!gadgetP)
{
// ... error handling
handled = false;
break;
}
handled = true;
break;
by(e)
Stephan
--
PGP Fingerprint: 0090 E02F 39A8 F2AF 6A79 43D7 B847 C26D 108E E2F0
PGP PublicKey: http://www.unet.univie.ac.at/~a9526342/sveigl.asc
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/