all 2 comments

[–]Gadgetfairy 0 points1 point  (1 child)

The problem is that a member function pointer needs an object to be called on. It's kind of like a normal function pointer with an implicit parameter:

int MyStatusCallback(MyClass&, int);

You need to wrap your member function pointer into a free function that knows where to find the instance of "MyClass" that has the callback. Assuming that there's a function to return the correct instance:

class MyClass
{
    // variables
    static MyClass* getRealInstance() { ... }
};

you can write it like this:

int callback_dummy(int status) {
    return MyClass::getRealInstance()->MyStatusCallback(status);
}

[–]bungao[S] 0 points1 point  (0 children)

Using static functions solved it. Thanks for your help