|
-
Dec 18th, 2001, 10:19 PM
#1
Thread Starter
Addicted Member
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?
-
Dec 22nd, 2001, 02:24 PM
#2
I think the failure lies somewhere else, not in this part of the code.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|