Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to delete an object Pin
Jon Hulatt9-Aug-02 1:15
Jon Hulatt9-Aug-02 1:15 
AnswerRe: how to delete an object Pin
Tomasz Sowinski9-Aug-02 1:34
Tomasz Sowinski9-Aug-02 1:34 
GeneralRe: how to delete an object Pin
Jon Hulatt9-Aug-02 2:56
Jon Hulatt9-Aug-02 2:56 
AnswerRe: how to delete an object Pin
Mike Upton9-Aug-02 1:35
Mike Upton9-Aug-02 1:35 
GeneralGetting the menu of the CMDIChildWnd Pin
Poul Haahr Klemmensen9-Aug-02 0:43
Poul Haahr Klemmensen9-Aug-02 0:43 
GeneralRe: Getting the menu of the CMDIChildWnd Pin
Tomasz Sowinski9-Aug-02 0:59
Tomasz Sowinski9-Aug-02 0:59 
GeneralRe: Getting the menu of the CMDIChildWnd Pin
Steen Krogsgaard9-Aug-02 1:04
Steen Krogsgaard9-Aug-02 1:04 
GeneralRe: Getting the menu of the CMDIChildWnd Pin
Mike Upton9-Aug-02 1:27
Mike Upton9-Aug-02 1:27 
Why not just use an update handler (ON_UPDATE_COMMAND_UI) and forget about trying to get hold of the menu item? Update handlers are an easier and clearer way of controlling the state of menu items, and have the added bonus of handling things like toolbar buttons at the same time.

But if you still insist on trying to use the menu pointer, the main reason you're having trouble is that MDI child windows don't have their own menus. Only the main frame window has a menu, it just changes its menu when different child windows are activated.

If you're still interested, have a look at the source code for CMDIFrameWnd and CMDIChildWnd (in AFXWIN.H and WINMDI.CPP), in particular at OnUpdateFrameMenu. The code responsible for swapping the main frame's menu in MDI apps is not very well documented in the MFC docs, but the source code is fairly clear (as far as MFC source goes).



"We are the knights who say Ni" (The Knights Who Say Ni)
GeneralRe: Getting the menu of the CMDIChildWnd Pin
Poul Haahr Klemmensen9-Aug-02 3:46
Poul Haahr Klemmensen9-Aug-02 3:46 
GeneralRe: Getting the menu of the CMDIChildWnd Pin
Mike Upton9-Aug-02 3:56
Mike Upton9-Aug-02 3:56 
GeneralSimple question on Dialogboxes Pin
D Satya9-Aug-02 0:43
D Satya9-Aug-02 0:43 
GeneralRe: Simple question on Dialogboxes Pin
Steen Krogsgaard9-Aug-02 1:08
Steen Krogsgaard9-Aug-02 1:08 
GeneralRe: Simple question on Dialogboxes Pin
D Satya9-Aug-02 1:44
D Satya9-Aug-02 1:44 
GeneralRe: Simple question on Dialogboxes Pin
Steen Krogsgaard9-Aug-02 1:51
Steen Krogsgaard9-Aug-02 1:51 
GeneralRe: Simple question on Dialogboxes Pin
D Satya9-Aug-02 18:09
D Satya9-Aug-02 18:09 
GeneralCListBox takes up 100% CPU usage Pin
KHYEE9-Aug-02 0:31
KHYEE9-Aug-02 0:31 
GeneralRe: CListBox takes up 100% CPU usage Pin
Tomasz Sowinski9-Aug-02 1:02
Tomasz Sowinski9-Aug-02 1:02 
GeneralRe: CListBox takes up 100% CPU usage Pin
Anonymous11-Aug-02 22:29
Anonymous11-Aug-02 22:29 
GeneralRe: CListBox takes up 100% CPU usage Pin
Shog99-Aug-02 4:45
sitebuilderShog99-Aug-02 4:45 
GeneralRe: CListBox takes up 100% CPU usage Pin
KHYEE12-Aug-02 18:32
KHYEE12-Aug-02 18:32 
GeneralRe: CListBox takes up 100% CPU usage Pin
Shog912-Aug-02 19:02
sitebuilderShog912-Aug-02 19:02 
GeneralInserting bitmap into RTF Pin
Hans Ruck9-Aug-02 0:31
Hans Ruck9-Aug-02 0:31 
GeneralCBitmap vs. HBITMAP Pin
[CoY0te]9-Aug-02 0:23
[CoY0te]9-Aug-02 0:23 
GeneralRe: CBitmap vs. HBITMAP Pin
[CoY0te]9-Aug-02 1:43
[CoY0te]9-Aug-02 1:43 
GeneralRe: CBitmap vs. HBITMAP Pin
Ernest Laurentin9-Aug-02 6:36
Ernest Laurentin9-Aug-02 6:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.