By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,515 Members | 1,772 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,515 IT Pros & Developers. It's quick & easy.

MFC: execution flow not going through CMDIFrameWnd::OnRButtonUp()

P: 3
I have a "class MainFrame : public CMDIFrameWnd" implemented like this:

Expand|Select|Wrap|Line Numbers
  1. IMPLEMENT_DYNAMIC(MainFrame,CMDIFrameWnd)
  2.  
  3. BEGIN_MESSAGE_MAP(MainFrame,CMDIFrameWnd)
  4.     ON_WM_RBUTTONUP()
  5. END_MESSAGE_MAP()
  6.  
  7. MainFrame::MainFrame() {
  8.     Create(NULL,"Battleship");
  9. }
  10.  
  11. BOOL MainFrame::OnCreateClient(LPCREATESTRUCT lpcs,CCreateContext *pContext) {
  12.     return CreateClient(lpcs,NULL);
  13. }
  14.  
  15. afx_msg void MainFrame::OnRButtonUp(UINT nFlags,CPoint point) {
  16.     AfxMessageBox(_T("hello"));
  17. }
But the AfxMessageBox() will never get called when I release the right button of the mouse after I click on the grey area of the MDI frame. Of course, a MainFrame object is set as the CWinApp's m_pMainWnd. What am I missing ?
May 26 '07 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
Do you DECLARE_MESSAGE_MAP in your MainFrame window?
May 27 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.