Guys-

Thanks for the response. That's pretty much what I figured, I just wanted to be sure. 
To clarify,

I will make:

static  void StuffViewDrawName(...); // static method

Then, I will stuff into the TableRowData the 'this' pointer for the current object, 
and then in my static callback, I can access things in the class like:

void
StuffViewDrawName(...)
{
        StuffClass*     myThis = grabTableData(row);
        WinDrawChars(myThis->getTextString(), ...);
}

Does that sound like a plan?

BTW - thanks a TON for the quick help!

Alan

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


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