Original Post
i'm having trouble make a function pointer return a class thats derived from that function pointer's return value. it says:
:\XGP\Engine\Actor.cpp(4) : error C2664: '__thiscall CClass::CClass(class CString,class CString,class CObject *(__cdecl *)(void),class CString (__cdecl *)(void),class CString (__cdecl *)(void))'
: cannot convert parameter 3 from 'class CActor * (__cdecl *)(void)' to 'class CObject * (__cdecl *)(void)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
CActor is derived from CObject, but it still doesn't work. i was thinking about pointers to pointers, and dereferncing it in function call, but i want to know why this doesn't work also
edit: the italic part is the message that matters, the bold are the two classes that should be able to be convert without a cast
edit again: i also have two other function pointers set up EXACTLY the same way except for the return value, and they both work, so i'm almost positive its the function return values and not the functions themselves.
[edited by - billybob on March 8, 2003 11:00:18 PM]
[edited by - billybob on March 8, 2003 11:03:42 PM]