Question : Inserting a CMenu in to main menu bar

Hi All,

I am using MFC in Visual Studio 2008.  I have a CMDIFrameWndEx which has a CMFCMenuBar as the app-wizard provides.

I also have a menu resource, IDR_SCENE.

At runtime, I want to add the IDR_SCENE menu dynamically to the main menu bar.  Declaring the menu in my class:

1:
CMenu m_sceneMenu;


I then try and insert it like this during creation:

1:
2:
3:
m_sceneMenu.LoadMenu(IDR_SCENE);
::InsertMenu(pParentWnd->GetMenuBar().GetHMenu(), 0, MF_BYPOSITION | MF_POPUP, reinterpret_cast<UINT_PTR>((HMENU)(*m_sceneMenu.GetSubMenu(0))), NULL);


But, I never, ever see it.  No errors occur.  I have done some searching and this appears to be the way to do it.


Can anyone assist?


Thanks in advance

Answer : Inserting a CMenu in to main menu bar

Press F8 during boot to get to the advanced boot options menu, then pick the option to disable reboot on error. Then, instead of the boot loop, you'll get the BSOD with the error message. What is the message?
Random Solutions  
 
programming4us programming4us