Assuming that the data coming in through the void*
is a pointer to Myclass
, you need to add a reinterpret_cast
from the void*
, like this:
Myclass *a = reinterpret_cast<Myclass*>(data);
This will tell the compiler that you know for sure that the data
is a pointer to Myclass
, letting you call MyMemberFunction()
through that pointer.