You are not allowed to use the method of a class inside of a callback because
there is an implied 'this' pointer that the callback doesn't know how to
handle.
If this is the case, you can get around this by making your class
callback funtion (StuffViewDrawName()
) static and having a global variable that holds onto the 'this' pointer for
you to use to resolve the object inside of the callback.
-Pete
<< Hi everyone-
I have a class for a table, and it has methods for the callbacks such as:
void
TabContents::StuffViewDrawName (void *tableP, Int16 row, Int16 column,
RectangleType *bounds)
{
...
}
and I'm trying to pass this to the Tbl manager:
TblSetCustomDrawProcedure(t, STUFF_TABLE_NAME_COLUMN, StuffViewDrawName);
But the compiler gives me the error:
Error : cannot convert
'void (ProductTabContents::*)(void *, short, short, RectangleType *)' to
'void (*)(void *, short, short, RectangleType *)'
ProductTabContents.cpp line 58 TblSetCustomDrawProcedure(t,
STUFF_TABLE_INFO_COLUMN, StuffViewDrawName);
----
I'd appreciate any ideas on the subject. Thanks!
Alan Pinstein
Synergy Solutions, Inc. >>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/