Page 1 of 1

Beowulf Needs Help (Programming, not the Mental kind)

Posted: 2006-01-31 07:25pm
by Beowulf
MyMenuApp::MyMenuApp(void)
{
AddMenuItem("blah", reinterpret_cast<void(__thiscall MenuApp::*)(void)> (&MyMenuApp::GetVoltage));
}

error C2440: 'reinterpret_cast' : cannot convert from 'void (__thiscall MyMenuApp::* )(void)' to 'void (__thiscall MenuApp::* )(void)'
Pointers to members have different representations; cannot cast between them

MyMenuApp is a subclass of MenuApp. How can I fix this error? Note: I need to use pointer to member functions to get full credit. MenuApp can't explicitly take pointer to member functions of class MyMenuApp, because it's supposed to be a framework function.