Beowulf Needs Help (Programming, not the Mental kind)

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
Beowulf
The Patrician
Posts: 10621
Joined: 2002-07-04 01:18am
Location: 32ULV

Beowulf Needs Help (Programming, not the Mental kind)

Post 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.
"preemptive killing of cops might not be such a bad idea from a personal saftey[sic] standpoint..." --Keevan Colton
"There's a word for bias you can't see: Yours." -- William Saletan
Post Reply