Click here to Skip to main content
16,005,099 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Import a "C" function that returns a struct... Pin
Robert A. T. Káldy17-Feb-04 0:42
Robert A. T. Káldy17-Feb-04 0:42 
Generallocking toolbars in place ... Pin
Maximilien16-Feb-04 7:47
Maximilien16-Feb-04 7:47 
GeneralRe: locking toolbars in place ... Pin
David Crow16-Feb-04 7:59
David Crow16-Feb-04 7:59 
GeneralScientific Notation Pin
Walt_S16-Feb-04 6:28
Walt_S16-Feb-04 6:28 
GeneralRe: Scientific Notation Pin
David Crow16-Feb-04 7:22
David Crow16-Feb-04 7:22 
GeneralRe: Scientific Notation Pin
Walt_S16-Feb-04 7:27
Walt_S16-Feb-04 7:27 
QuestionHow to access and Modify the Child Window Menu Pin
Omar Alvi16-Feb-04 6:20
Omar Alvi16-Feb-04 6:20 
AnswerRe: How to access and Modify the Child Window Menu Pin
Antti Keskinen16-Feb-04 9:49
Antti Keskinen16-Feb-04 9:49 
From MSDN Library:

An MDI child window does not have a menu bar of its own, but instead shares the menu of the MDI frame window. The framework automatically changes the MDI frame menu to represent the currently active MDI child window.

This explicitly states that by using base-MFC, you cannot have a MDI Child window with a real menu bar, but the menu associated with the child window is automatically replacing the frame window's menu when you give focus to a child frame.

You need to rebuild some basic functionality automatically provided to you by the framework if you want to achieve a child frame with a menu. Firstly, you need to derive a new class from CFrameWnd. This will be your child frame class. Give it a ON_WM_CREATE handler and force it to load a menu by explicitly creating a CMenu object and calling CWnd::SetMenu. Frame windows support menus, so the call is valid. After this, you need to create a view and bind it to the child frame.

Lastly, you must create a handler for command ID_FILE_NEW on your parent frame window. Here, you must manually create a child frame window and show it.

In order to get you into a good start, create a new MDI project and remove the tick 'Doc/View arhitecture'. Examining the generated code gives you an idea of the processes required to create non-doc/view MDI applications.

-Antti Keskinen


----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: How to access and Modify the Child Window Menu Pin
Omar Alvi16-Feb-04 18:14
Omar Alvi16-Feb-04 18:14 
GeneralRe: How to access and Modify the Child Window Menu Pin
Antti Keskinen16-Feb-04 22:01
Antti Keskinen16-Feb-04 22:01 
GeneralToolBar problem Pin
Deian16-Feb-04 6:03
Deian16-Feb-04 6:03 
GeneralRe: ToolBar problem Pin
LunaticFringe16-Feb-04 7:47
LunaticFringe16-Feb-04 7:47 
GeneralRe: ToolBar problem Pin
Deian16-Feb-04 7:54
Deian16-Feb-04 7:54 
GeneralGDI+ Pin
Prakash Nadar16-Feb-04 5:40
Prakash Nadar16-Feb-04 5:40 
GeneralRe: GDI+ Pin
Steve S16-Feb-04 6:19
Steve S16-Feb-04 6:19 
GeneralRe: GDI+ Pin
Prakash Nadar16-Feb-04 16:44
Prakash Nadar16-Feb-04 16:44 
GeneralPrinting Icons Pin
Julio Garvía Honrado16-Feb-04 5:22
sussJulio Garvía Honrado16-Feb-04 5:22 
Questionhow to detect bluetooth ports on different windows platforms? Pin
haritadala16-Feb-04 5:09
haritadala16-Feb-04 5:09 
GeneralStrange behaviour of VC6 on XP pro Pin
Bin2Hex16-Feb-04 4:58
Bin2Hex16-Feb-04 4:58 
GeneralDynamic list view Pin
status16-Feb-04 4:52
status16-Feb-04 4:52 
GeneralRe: Dynamic list view Pin
David Crow16-Feb-04 7:25
David Crow16-Feb-04 7:25 
GeneralRe: Dynamic list view Pin
status16-Feb-04 21:44
status16-Feb-04 21:44 
GeneralRe: Dynamic list view Pin
David Crow17-Feb-04 2:19
David Crow17-Feb-04 2:19 
GeneralRe: Dynamic list view Pin
status17-Feb-04 21:20
status17-Feb-04 21:20 
GeneralSetting the width of a subclassed Spin Button Pin
jlmiramo16-Feb-04 4:34
jlmiramo16-Feb-04 4:34 

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.