Ben,

I'm sorry I wasn't more clear. Sometimes brevity isn't always best <g>. This
is not the actual callback. I have a static callback that dispatches to the
correct class instance.

I'm not sure what you mean regarding the "this" pointer is the handle. In
this case, GetHandle() returns a handle to a Palm OS table structure. The
"this" pointer is a "handle" to my class instance. GetHandle() returns the
PalmOS handle associated with that class instance. GetHandle() actually
resides in a base class called zpObject. All my UI objects derive from this
class.

I appreciate the quick response though. In fact, it is entirely possible
that my problem lies within my architecture. I'm hoping someone can give me
some insight into what the error messages are trying to tell me.

Eric

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ben
Combee
Sent: Monday, November 20, 2000 2:11 PM
To: Palm Developer Forum
Subject: Re: Problems with tables


> I get these errors without editing any values. Here is the load data
> callback.
>
> Err pcMainTable::LoadData( Word row, Word column, Boolean editable,
>                            VoidHand *data, WordPtr dataOffset,
>                            WordPtr dataSize, FieldPtr fld )

This callback doesn't match the parameter list for the code called by the
system... it wants a function that matches

Err TableLoadDataFuncType (
    void *tableP, Int16 row, Int16 column,
    Boolean editable, MemHandle *dataH, Int16 *dataOffset,
    Int16 *dataSize, FieldPtr fld)

Your callback function has a different signature, leading with a hidden
"this" parameter, then all the parameters that are expected.  In your first
line, you're calling a method, which could be written as

   TablePtr table = this->GetHandle();

but your "this" value is actually already the handle to the table, so you're
doing really odd stuff.

Callbacks to C++ member functions really need static members so you don't
have the implicit "this" pointer messing up the function signature.  I
looked at doing something like this, but in order to do it right, you need
an extra data structure that would map table handles to your table wrapper
object.

--ben



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