I'm having a hard time to cast a pointer for a method in cpp from a different class. The method goes as follows:
The file that I'm passing the method:
void TimeCounterClass::DelayMili(uint8_t pMili, bool & pFlag, void(*doWhile)(void))
{
tmpTicks = TimeSpan.Ticks + pMili;
while ((!pFlag) && (TimeSpan.Ticks <= tmpTicks))
{
doWhile();
}
}
The file that I'm trying to execute DelayMili:
bool lValue = false;
void AnotherClass::MessageArrive()
{
// doSomething...
}
void AnotherClass::AnotherClass()
{
TimeCounter.DelayMili(3000, lValue, (void(*)(void))(&MessageArrive)); // wrong casting
}