Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all.

I want to create the menu on 'CChildFrame'. (in MDI)

But really I don't know..

Please advise me.. Thank you. :)

What I have tried:

I used this code.
But it doesn't work.

CMenu *pMenu;
pMenu = LoadMenu(IDR_MYMENU);

SetMenu(pMenu);
Posted
Updated 18-May-16 6:12am
Comments
Richard MacCutchan 18-May-16 4:39am    
Child windows do not have frames to add menus on. Main menus go on your main frame window. You can modify your menus according to which child window is active.

1 solution

The traditional way of having child specific menus in an MDI application is to modify the parent or main frame window's menu.

One strategy is to create the menu with the items you want on it when you create the child (say as a member of the child) and when it gets focus you append it to the main window's menu.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900