So I was wondering is how could I make the following possible? In my current attempts I get a compiler error one way or another
I was wondering if it was possible to have a member function of a class. Then get the pointer to that member function.
Something like:
//Header
class TestClass
{
public:
void Init(AnotherObject *anotherObject);
void MyFunction();
};
//Imp
void TestClass::Init(AnotherObject *anotherObject)
{
//Callback is a void (*AnotherObjectCallback::callback)()
//This code is broken. How can I do this?
anotherObject->callback = &this->MyFunction
}
void TestClass::MyFunction()
{
//Do stuff!
}