Problems with MenuEvents on Controls
-
Hi, i've made a menu with a few items. The called handlers are in "MainFrm.cpp" as On... implemented. So far so good... BUT when the focus is on an control in a sdi view of the main program i can't get the event. My Program does nothing when i click on the menuitem. How can my control get informed, when a menuitem event is fired ? Marco
-
Hi, i've made a menu with a few items. The called handlers are in "MainFrm.cpp" as On... implemented. So far so good... BUT when the focus is on an control in a sdi view of the main program i can't get the event. My Program does nothing when i click on the menuitem. How can my control get informed, when a menuitem event is fired ? Marco
Are you awating the event in the CMainFrame::On... while the control has focus, or in the control itself (C?Control::On...)? Is'nt the message trapped in the CMainFrame::On..., while You are awaiting it in the control? The menu generates WM_COMMAND message which is send to the application message main message handling loop. The handler for the message is then searched in the main window, if not found in it, the handler is searched in the child window with focus and so on. Sonork 100.15206;PavelK
-
Are you awating the event in the CMainFrame::On... while the control has focus, or in the control itself (C?Control::On...)? Is'nt the message trapped in the CMainFrame::On..., while You are awaiting it in the control? The menu generates WM_COMMAND message which is send to the application message main message handling loop. The handler for the message is then searched in the main window, if not found in it, the handler is searched in the child window with focus and so on. Sonork 100.15206;PavelK
-
Hi, the message handler code is in CMainFrame, but it is not called if the focus is at the control. The menuitem code CMainFrame::On... should work at the whole application, independently which control the focus has. Marco
You are right. Can't figure where the problem can be :confused:. Is the control a standard one? Sonork 100.15206;PavelK
-
You are right. Can't figure where the problem can be :confused:. Is the control a standard one? Sonork 100.15206;PavelK