I’m trying to do it
class Foo
{
static int ReadSelfFromBase(void *userarg, int argc, char **argv, char **ColName){...}
public:
void Bar(sqlite3* db)
{
...
rc = sqlite3_exec(db, "select * from test", &ReadSelfFromBase, this, &zErrMsg);
...
}
}
int main()
{
Foo test;
...
test.Bar(db);
}
But callback doesn’t call. If a do this
int main()
{
rc = sqlite3_exec(db, "select * from test", Foo::ReadSelfFromBase, NULL, &zErrMsg);
}
it all well. Does anybody know how solve this problem
PS Sorry for bad English
Since ReadSelfFromBase is a static function, Foo::ReadSelfFromBase should work the same in the Bar method as it does in main.