April 1st, 2014, 10:34 AM
Overridden CWinApp::OnFileOpen() handler
I am working on an existing project and noticed some interesting phenomenon. I then created a small project and reproduced this behavior.
When I created a new project, the system provided a default message handler for the file open menu item like this:
Then I added an message handler in CMainFrame class:
Now when I click the menu item "File"->"Open", the new added handler in CMainFrame is called.
My question is: How does CWinApp::OnFileOpen() get overridden? How does the framework know CMainFrame::OnFileOpen() should be called in stead of CWinApp::OnFileOpen()?
Another question is: Does MFC support multiple handlers for one message? How do we avoid conflicting behaviors?
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.