function pointers in c++ classes
Hiya.
Im making my first game in c++ with DirectX, but at the moment i'm working on the control engine. I wanted to use function pointers to call a function specific to an object, an instance of my objects class. I have made a message stack, but want to have each message handled differently for each object i instaciate. Follow?
Any way, i'm a little stumpes on how to call this function, or even how to set it up. Currently, the prototype inside the class is
int (DefProcedure*)(UINT Msg, WPARAM wParam, LPARAM lParam);
But how would i then call this? So far the compiler has thrown back an error for every time i've tried to set the pointer to a function. Methods i've tried:
player.DefProcedure = proc();
CPlayer::DefProcedure = proc();
DefProcedure = proc();
even
player.DefProcedure() = proc()
yet everyone has been rejected. Please can someone correct this sow i can continue with the engine. Thx
optimism_