In my actual project, I needed a way to get a
void*
to a
Memberfunction
but the compiler would just throw cast errors at me. So I just used the way in which the compiler implemented these calls.
void* p;
__asm MOV eax,offset MyClass::MyFunction
__asm MOV p,eax
or as Macro:
#define MEMBERPTR(f,v) __asm MOV eax,offset f \
__asm MOV v,eax
This will give you the correct address of virtual and normal member functions.
Tested on MSVC++ 2008.
Might be different on other Compilers!