From: "Jason Partyka" <[EMAIL PROTECTED]>
Subject: weird object not in form error


> POSE reports:
> "Form.c, Line:1300, Object not in form"
> ...
> FieldPtr field;
> field = (FieldPtr) FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP,
NewCustomerFldNewCustomerField));

(Adam: this might be a good entry for the FAQ.  However, I think it's
already in the KB somewhere.)

The question is: what form does frmP refer to at the time you execute this?
A common mistake is to use

    frmP = FrmGetActiveForm();

when it would be safer to use:

    frmP = FrmGetFormPtr( YourForm );

The reason not to use FrmGetActiveForm() is that your form may not be the
active form.  The user might have opened the Find dialog, or a List or other
object that uses it's own form may be open.  In this case, the object you
are looking for is not available on the current form.  So to avoid this
problem, use FrmGetFormPtr().



-- 
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