well that class compiles, but when i use it it starts giving me errors
this is where the function pointer is defined
CRobots class...Code:template<class InputType, class ReturnType, class ParamType1, class ParamType2> class CMenuItem { public: typedef ReturnType (*FUNCTION_PTR)(ParamType1, ParamType2); void SetFuncPtr(FUNCTION_PTR Func); private: FUNCTION_PTR m_pFunc; }
and the function i'm attempting to call that isn't compiling right...Code:CRobot* SendToJob(CJob* Job, int i);
Code:menuItem->SetFuncPtr(robots.SendToJob); ----------------------------------------------------------------- error C2664: 'SetFuncPtr' : cannot convert parameter 1 from 'class CRobot *(class CJob *,int)' to 'class CRobot *(__cdecl *)(class CJob *,int)'




Reply With Quote