"Richard Burmeister" <[EMAIL PROTECTED]> wrote in message
news:32402@palm-dev-forum...
>
> From: "Jon Zaring" <[EMAIL PROTECTED]>
>
> >  frmP = FrmInitForm (AboutForm);
> > FrmSetActiveForm(frmP);
> > CtlSetValue((ControlType *)GetObjectPtr(AboutTestCheckbox),0);
> > FrmDoDialog (frmP);
> > Int16 iTemp = CtlGetValue((ControlType
*)GetObjectPtr(AboutTestCheckbox));
> >  // The following line is erroring out on me . . . looks like the stack
is
> clobbered
> > CtlSetValue((ControlType *)GetObjectPtr(AboutTestCheckbox),0);
> > FrmDoDialog (frmP);     // Display the About Box.
> > FrmDeleteForm (frmP);
>
> What environment are you using?  CodeWarrior won't even compile this.  It
> doesn't like the Int16 declaration in the middle of the switch inside of
> MainFormDoCommand, complaining about "expression syntax error".  Perhaps
> your compiler doesn't like it either, but doesn't tell you.

CodeWarrior with the PalmOS 3.5 SDK does like this, since Int16 and UInt16
are the types that replaced SWord and Word.  Also, the declaration is legal
if compiled as C++, although declarations in the middle of a switch are a
bit unusual due to problems with constructor/destructor scoping.

My guess at the error is your calls to GetObjectPtr -- that uses the active
form to look up the control, but the AboutTestCheckbox is an element of your
AboutForm which is only active during the call to FrmDoDialog.  The rest of
the time, your form that's doing this calling is active, and it doesn't have
that control in it.  You need to explicitly lookup the controls in the
AboutForm in order to manipulate them.

--
Ben Combee
Veriprise Wireless <http://www.veriprise.com>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to