I am using a C-based library (sqlite) from my C++ program. This library includes a function which takes a pointer to a callback. I'd like to use a member function as the callback.
sqlite3_exec(sldbDatabase, "", &(this->AddFarmFromRow), this, &sError);
The first parameter passed to the callback function is the parameter in bold above. I know, from other programs I've done, that this should work just fine, if I can get the address to this function. This is what I get instead, however:
error C2276: '&' : illegal operation on bound member function expression
According to MSDN, this error relates to taking the address of a virtual function. Unfortunately, this isn't a virtual function. Even if it were, I could still make it work if I could extract the function pointer from the virtual function call table. Thus, my question:
How can I get a pointer to a member function for a specific object?
sqlite3_exec(sldbDatabase, "", &(this->AddFarmFromRow), this, &sError);
The first parameter passed to the callback function is the parameter in bold above. I know, from other programs I've done, that this should work just fine, if I can get the address to this function. This is what I get instead, however:
error C2276: '&' : illegal operation on bound member function expression
According to MSDN, this error relates to taking the address of a virtual function. Unfortunately, this isn't a virtual function. Even if it were, I could still make it work if I could extract the function pointer from the virtual function call table. Thus, my question:
How can I get a pointer to a member function for a specific object?