Calling a virtual function crashed my program
Hello,
I'm actually creating an agenda. To make it easier to update, I created a DLL containing the class CAgenda. Some function of that agenda are virtual, such as the MonthChanged in order that my main application know when the month change. When my main application call SetMonth, it execute and the virtual function execute. But when my CAgenda call SetMonth, the program crashes at the moment it call the virtual function.
Here my code:
PHP Code:
void CAgenda::SetCurrentMonth()
{
SetMonth(GetCurrentMonth())
}
void CAgenda::SetMonth(Month NewMonth)
{
Month temp = NewMonth;
MonthChanged(temp);
m_Month = temp;
}
void CAgenda::MonthChanged(Month &month)
{
return;
}
So, I my program call SetMonth, all work, but if it call SetCurrentMonth, my program crash at the moment it call MonthChanged. Someone know why?