Pointers to class members
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
class foo
{
public:
foo() {
Handler = &foo::MyHandler;
}
int MyHandler() {
return 0;
}
private:
typedef int (*HANDLER_CALLBACK)();
HANDLER_CALLBACK Handler;
};
|
On line 5, I get the following error:
cannot convert from 'int (__thiscall foo::* )(void)' to 'foo::HANDLER_CALLBACK' [There is no context in which this conversion is possible] |
Any ideas?
Line 13 should be
typedef int (foo::*HANDLER_CALLBACK)();
Thanks a lot!
Topic archived. No new replies allowed.