From: "Fergal Moran" <[EMAIL PROTECTED]>
Subject: Object not in form (but it is!!!)
> Using CW6 - all the latest patches SDK 3.1 - my application works fine -
> however - when I download to to a palm V (OS 3.3) - and tap the icon in
the
> launcher - I get an error
>
> "Form.c, Line:1300,Object not in form"
>
> The first form that is loaded - only contains one object - a listbox and
> nothing else - no buttons or menus or anything else - and my application
> does not reference anything else at that time. Also - I cannot debug on
the
> device - because I have never been able to get that to work.
"Object not in form" is most often caused by attempting to refer to an
object in the "current form" without verifying what form that actually is.
If I remember correctly, a listbox actually is a form, so if the current
form is the listbox and your code attempts to get a pointer to the listbox
by referring to an object index in the current form, then it will fail.
The safe way to get a pointer to an object on a form (MainForm, for example)
is to use
FormPtr frmP = FrmGetFormPtr( MainForm );
instead of
FormPtr frmP = FrmGetActiveForm();
Then you can use
ObjectType *objectP = FrmGetObjectPtr( frmP, FrmGetObjectIndex( frmP,
YourObjectID ) );
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/