--- Jeremy Bradshaw <[EMAIL PROTECTED]> wrote:
> Does anyone know what causes the following error?
>     Form.c, Line: 1728, Object not in form

FrmGetObjectIndex() gets two arguments: a pointer to a form, and an
object ID.  It looks at every object on the form and returns the index
of the one that matches the ID.  If it can't find a matching object,
you get the above error.

There are two likely causes:

1. You used FrmGetActiveForm() to get the form pointer, but the active
form is not the one that has your object.  Some UI elements (Lists, I
think) have their own forms, so FrmGetActiveForm() may not return the
form you think it will return.  To fix this, use FrmGetFormPtr() to get
the form pointer.

2. You are creating form objects dynamically.  When you do this, the
form pointer gets changed because the OS actually creates a new form
and copies your old objects plus the new one to that new form. 
Therefore, when you use any of the FrmNewWhatever() functions, always
us the new form pointer afterwards.


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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

Reply via email to