Click here to Skip to main content
15,896,606 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Remove LAN-Adapter Pin
chrisigo4-Jul-05 4:04
chrisigo4-Jul-05 4:04 
Generalcopying a dialog box Pin
Anonymous3-Jul-05 23:38
Anonymous3-Jul-05 23:38 
GeneralRe: copying a dialog box Pin
2249174-Jul-05 0:18
2249174-Jul-05 0:18 
GeneralRe: copying a dialog box Pin
khan++4-Jul-05 0:36
khan++4-Jul-05 0:36 
GeneralRe: copying a dialog box Pin
Anonymous4-Jul-05 1:17
Anonymous4-Jul-05 1:17 
GeneralRe: copying a dialog box Pin
Rajesh match4-Jul-05 5:27
Rajesh match4-Jul-05 5:27 
Generalproject dependancies in vc6.00 Pin
rrrado3-Jul-05 23:20
rrrado3-Jul-05 23:20 
GeneralMFC: Use same menu for mainframe and childframe Pin
Wim Jans3-Jul-05 23:18
Wim Jans3-Jul-05 23:18 
Hello,

I'm having a bit of a problem using the same menu for my mainframe and childframe.
Basically I don't need the menu that comes with the childframe.

In my mainframe menu, I'm dynamically building one menu entry, and I don't want to do this processing for every child window I open, that's why I want to use the mainframe menu for the childmenu.

Is there a way to prevent loading of the childframe menu?

I tried to load the mainframe menu in the OnCreate Handler of my childframe, but that doesn't seem to work:

<br />
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) <br />
{<br />
	if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)<br />
		return -1;<br />
<br />
	CMDIFrameWnd* frame=(CMDIFrameWnd*)AfxGetMainWnd();<br />
	CMainFrame* mfrm;<br />
<br />
	mfrm=(CMainFrame*)frame;<br />
<br />
        CMenu NewMenu; <br />
	NewMenu.m_hMenu=mfrm->m_hMenuDefault;<br />
	ASSERT(NewMenu);<br />
	SetMenu(NULL);<br />
	::DestroyMenu(m_hMenuDefault); <br />
	SetMenu(&NewMenu);<br />
	m_hMenuDefault = NewMenu;<br />
<br />
	return 0;<br />
}<br />

GeneralRe: MFC: Use same menu for mainframe and childframe Pin
Iain Clarke, Warrior Programmer4-Jul-05 6:13
Iain Clarke, Warrior Programmer4-Jul-05 6:13 
GeneralRe: MFC: Use same menu for mainframe and childframe Pin
Wim Jans5-Jul-05 4:57
Wim Jans5-Jul-05 4:57 
Generaldeveloping software for windows server Pin
andrewpritchie3-Jul-05 22:55
andrewpritchie3-Jul-05 22:55 
GeneralHelp finding hook dll Pin
michaelnoam3-Jul-05 22:09
michaelnoam3-Jul-05 22:09 
GeneralRe: Help finding hook dll Pin
munawar19683-Jul-05 23:28
munawar19683-Jul-05 23:28 
GeneralRe: Help finding hook dll Pin
michaelnoam3-Jul-05 23:41
michaelnoam3-Jul-05 23:41 
GeneralRe: Help finding hook dll Pin
munawar19683-Jul-05 23:47
munawar19683-Jul-05 23:47 
GeneralRe: Help finding hook dll Pin
CorvetteZ06064-Jul-05 8:53
CorvetteZ06064-Jul-05 8:53 
GeneralRe: Help finding hook dll Pin
munawar19684-Jul-05 18:20
munawar19684-Jul-05 18:20 
GeneralRe: Help finding hook dll Pin
CorvetteZ06064-Jul-05 19:20
CorvetteZ06064-Jul-05 19:20 
Questionhow to get the domain name from a computer Pin
akayoku3-Jul-05 22:02
akayoku3-Jul-05 22:02 
AnswerRe: how to get the domain name from a computer Pin
2249174-Jul-05 1:27
2249174-Jul-05 1:27 
GeneralRe: how to get the domain name from a computer Pin
Anonymous4-Jul-05 16:38
Anonymous4-Jul-05 16:38 
GeneralRe: how to get the domain name from a computer Pin
2249174-Jul-05 17:24
2249174-Jul-05 17:24 
AnswerRe: how to get the domain name from a computer Pin
David Crow4-Jul-05 11:27
David Crow4-Jul-05 11:27 
GeneralName of this service Pin
Bernhard Hofmann3-Jul-05 20:53
Bernhard Hofmann3-Jul-05 20:53 
GeneralRe: Name of this service Pin
2249173-Jul-05 21:43
2249173-Jul-05 21:43 

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.