Click here to Skip to main content
15,916,042 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionList Control in MFC Pin
AnithaSubramani18-Jul-08 19:42
AnithaSubramani18-Jul-08 19:42 
AnswerRe: List Control in MFC Pin
Ștefan-Mihai MOGA18-Jul-08 21:44
professionalȘtefan-Mihai MOGA18-Jul-08 21:44 
Questiontab control with dialogs Pin
ani_ikram18-Jul-08 19:33
ani_ikram18-Jul-08 19:33 
QuestionRe: tab control with dialogs Pin
Rajesh R Subramanian18-Jul-08 22:00
professionalRajesh R Subramanian18-Jul-08 22:00 
QuestionHow often should you seed a random number generator? Pin
Sauce!18-Jul-08 19:30
Sauce!18-Jul-08 19:30 
AnswerRe: How often should you seed a random number generator? Pin
bob1697218-Jul-08 19:36
bob1697218-Jul-08 19:36 
QuestionAdd menu in ChilFrame. Pin
lavate malllik18-Jul-08 19:26
lavate malllik18-Jul-08 19:26 
AnswerRe: Add menu in ChilFrame. Pin
Nelek20-Jul-08 21:29
protectorNelek20-Jul-08 21:29 
In one project I used different Views with different Menus according to which was the active one. I did it creating the menus in the resource editor and then in the MyApp files (.h and .cpp) creating different CMultiDocTemplate one for each type of view, saying which menu was owned by which view.

BOOL CFPSApp::InitInstance()
{
	AfxEnableControlContainer();

.
.
//more code
.
.
//Main window menu
	pDocTemplate = new CMultiDocTemplate(
		IDR_FPSIITYPE,
		RUNTIME_CLASS(CFPSDoc),
		RUNTIME_CLASS(CChildFrame),		// Benutzerspezifischer MDI-Child-Rahmen
		RUNTIME_CLASS(CFPSView));
	AddDocTemplate(pDocTemplate);
.
//One of the child menu
	pParamRegMatTemplate = new CMultiDocTemplate(
		IDR_VIEWTYPE,				//Special menu for the view
		RUNTIME_CLASS(CFPSDoc),
		RUNTIME_CLASS(CChildFrame),		//Some special features for the view
		RUNTIME_CLASS(CParamRegView));		//View for the Regler
	AddDocTemplate(pParamRegMatTemplate);
.
//More code
}


this option is good when you know for sure how your project is going to be structured. There are other options to load/unload menus dinamically. If you use it you will have to load/unload the menu in the OnInitialUpdate and when your view loses and wins the focus another time. With the other way I have explained all is done automatically.

Regards.
--------
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.

QuestionMullti line in combobox Pin
sheshidar18-Jul-08 18:42
sheshidar18-Jul-08 18:42 
AnswerRe: Mullti line in combobox Pin
Ștefan-Mihai MOGA18-Jul-08 21:50
professionalȘtefan-Mihai MOGA18-Jul-08 21:50 
QuestionRe: Mullti line in combobox Pin
David Crow19-Jul-08 11:20
David Crow19-Jul-08 11:20 
QuestionHow to install dao database application? Pin
includeh1018-Jul-08 13:22
includeh1018-Jul-08 13:22 
AnswerRe: How to install dao database application? Pin
Garth J Lancaster18-Jul-08 13:48
professionalGarth J Lancaster18-Jul-08 13:48 
AnswerRe: How to install dao database application? Pin
bob1697219-Jul-08 16:50
bob1697219-Jul-08 16:50 
QuestionCross-session detection of running programs Pin
luweewu18-Jul-08 10:20
luweewu18-Jul-08 10:20 
AnswerRe: Cross-session detection of running programs [modified] Pin
Mark Salsbery18-Jul-08 11:33
Mark Salsbery18-Jul-08 11:33 
GeneralRe: Cross-session detection of running programs Pin
Randor 18-Jul-08 13:56
professional Randor 18-Jul-08 13:56 
GeneralRe: Cross-session detection of running programs Pin
Mark Salsbery19-Jul-08 7:19
Mark Salsbery19-Jul-08 7:19 
AnswerRe: Cross-session detection of running programs Pin
kinar18-Jul-08 12:09
kinar18-Jul-08 12:09 
GeneralRe: Cross-session detection of running programs Pin
Stephen Hewitt20-Jul-08 13:38
Stephen Hewitt20-Jul-08 13:38 
GeneralRe: Cross-session detection of running programs Pin
kinar20-Jul-08 18:19
kinar20-Jul-08 18:19 
GeneralRe: Cross-session detection of running programs Pin
luweewu22-Jul-08 11:14
luweewu22-Jul-08 11:14 
AnswerRe: Cross-session detection of running programs Pin
luweewu24-Jul-08 7:31
luweewu24-Jul-08 7:31 
AnswerRe: Cross-session detection of running programs Pin
Big Daddy Farang18-Jul-08 12:23
Big Daddy Farang18-Jul-08 12:23 
QuestionHelp update window display Pin
Kwanalouie18-Jul-08 10:19
Kwanalouie18-Jul-08 10:19 

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.