From: "Vikas Varshney" <[EMAIL PROTECTED]>
Subject: Object not in form error...
> Now the problem starts. Now if  I try to get
> Object Index (using FrmGetObjectIndex(..)), it gives me
> error dialog saying "Object Not In Form...". What could
> be the reason for this error? Any
> suggestion is welcomed.

I'm not sure if this applies in the case you described, but the current form
is not always the form you think is current (e.g. if the Find dialog is
open, or if you tapped inside a List, and probably at other times).  What
this means is that, instead of using:

FormPtr frmP = FrmGetActiveForm();
UInt16 index = FrmGetObjectIndex( frmP, YourTextField );
void *objectP = FrmGetObjectPtr( frmP, index );

it is safer to use:

FormPtr frmP = FrmGetFormPtr( YourForm );
UInt16 index = FrmGetObjectIndex( frmP, YourTextField );
void *objectP = FrmGetObjectPtr( frmP, index );

whenever there is a chance that YourForm is not the active form.



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