Well, this post might seem weird but as i am very much confused, i thought to seek some help from here.
My question is : When should i call a base class implementation of a message handler in my own implementation? ( I am talking about MFC.)
For example :

afx_msg return_type MyFrameClass::OnMessageHandler ()
{
   CFrameWnd::OnMessageHandler();
   // my code
}

I have also called the base class implementation of message handler in the above code.
However, as I found, it is necessary to call in some cases and it works if i dont do so in other cases.
How do I decide this? Or its just one more thing to remember? :|

I don't think there is any set rule -- depends on the message. Look at the message description in MSDN. Some say to return TRUE if you want to base class handler to be called, or FALSE if you don't. Also, in some cases you may want the base class to handle the message before you do, which is the case in the code snippet you posted. In other cases you may not want the base class to handle the message at all.

I don't think there is any set rule -- depends on the message. Look at the message description in MSDN. Some say to return TRUE if you want to base class handler to be called, or FALSE if you don't. Also, in some cases you may want the base class to handle the message before you do, which is the case in the code snippet you posted. In other cases you may not want the base class to handle the message at all.

You mean that its all the matter of remembering the handlers of which the base implementations are required to be called. And for the rest, its upon me whether to call or not. right?
OK then. I will try it out. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.