The form sure appears to be the active form, to me. I'm calling this fuction 
(getObjectPtr) when I press a button that's on the same form. 

I am sure FrmGetActiveForm is not returning NULL. I can examine the values of the 
FieldPtr using CodeWarrior's watch capability. The Field value in this FieldPtr is 
form 1300, and object 1302 is on form 1300.

-Jason

>>> [EMAIL PROTECTED] 08/29/00 02:30PM >>>
Perhaps the form with the field isn't the active form at the time you make
your call -- if that was the case, then FrmGetObjectIndex would give an
error because it wouldn't find the object ID.

You could even be calling this before a form has been displayed, when no
form is active -- make sure FrmGetActiveForm isn't returning NULL.

"Jason Partyka" <[EMAIL PROTECTED]> wrote in message
news:22680@palm-dev-forum...

This is related to my earlier post. I believe it's not a database issue but
something funky with the forms.

I'm having trouble getting the field pointer, and for no apparaent reason. I
have this cookbook function, from the Palm Programming book:

/* begin */

static VoidPtr GetObjectPtr(Word objectID)
{
FormPtr frmP;
VoidPtr fieldP;
Word index;
frmP = FrmGetActiveForm();

index = FrmGetObjectIndex(frmP, objectID); // the error is here
fieldP = (FrmGetObjectPtr(frmP, index));
return fieldP;
}

/* end */

the only difference is it's broken apart so I can watch the variables change
without stepping into the functions that change them.

so I pass an object ID into the form (ID 1302). It's passed in as a
constant.
the form Pointer returned by FormGetActiveForm is the proper form, form
1300.
1302 is the ID for a text field.

The error message that occurs at FrmGetObjectIndex(frmP, objectID) is:

"Application" 1.0 reports "WindowNew.c, Line 3112, Bad window". If this is
the lastest.....

Does anyone have any idea what may be going on?

I'm using the ROM  3.0 debug image on 3.0a7

-Jason




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


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