GetObject is getting a pointer to the specified object and is unaware of
what type of object it is. That is why it returns a void*. As the
programmer, you need to know which type of object it points to and use/cast
it appropriately. For example, in this case, ContactDetailFirstNameField
happens to be a field on the Form. Therefore, getObject will return a
FieldPtr. You might also use getObject on a table object and, in that case,
it would return a TablePtr.
//Ray

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Rochester,
Dean
Sent: Monday, February 05, 2001 7:33 AM
To: Palm Developer Forum
Subject: VoidPtr and FieldPtr Confusion

Hi

I am working through

Palm OS Programming from the Ground Up

and have run into a confusing situation.

In one example there is a function

static void setText(FieldPtr, CharPtr);

In the call for this function the FieldPtr parameter is supplied as
follows...

setText(getObject(form, ContactDetailFirstNameField), precord +
DB_FIRST_NAME_START);

in this setText call...

getObject  returns a VoidPtr

Is a  VoidPtr and a FieldPtr the same thing?

Thanks in advance


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