Alan Pinstein wrote:
>I have a class for a table, and it has methods for the callbacks such as:
<snip>
>and I'm trying to pass this to the Tbl manager:
<snip>
>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);
The draw procedure needs to be declared static.
That means, of course, that you can't access non-static class members
inside the routine, which may or may not be a problem for you.
If it is, one way around it is to store the "this" pointer in the table
items themselves when you build it, and then retrieve the pointer in the
draw routine, casting it to a pointer to your table class. Then you can
use that pointer to access the non-static bits of your class.
Dave Johnson
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/