Hello,
I have a mother class like that (I keep only the interessting part) :
Code :
namespace ZenZiAPI
{
class IModule
{
public:
typedef bool (IModule::*p_callback)(ITools&);
}
}
And a son class with two functions like that (The functions are simplified):
Code :
bool ModulePHP::GetPHP(Tools &_EOTools)
{
return (true);
}
const std::vector<std::pair<ZenZiAPI::IModule::p_callback, ZenZiAPI::hookPosition>>& ModulePHP::getCallbacks()
{
this->_LPHook.first = static_cast<ZenZiAPI::IModule::p_callback>(&ModulePHP::GetPHP);
}
The Error is on this lign :
Code :
static_cast<ZenZiAPI::IModule::p_callback>(&ModulePHP::GetPHP);
Compilation error :
Error 4 error C2440: 'static_cast' : cannot convert from 'bool (__thiscall ModulePHP::* )(Tools &)' to 'ZenZiAPI::IModule::p_callback'
I spent the day trying to find it out, somone knows what i can do ?
Thanks !
Last edited on
You can't cast pointers to functions.