Menubar in doc/view
-
Hello guru's, I've the feeling it's so simple, but I cannot manage it: :confused: We all know the standard menu in a MDI application made by MFC-wizard. But what I need now is having also the menu in each doc/view. I've tried some idea's, but they all failed. I succeeded in putting a toolbar and status bar, but the menu...arrghhhh!!! X| Do you have any idea's? Thanks in advance, EiSl
-
Hello guru's, I've the feeling it's so simple, but I cannot manage it: :confused: We all know the standard menu in a MDI application made by MFC-wizard. But what I need now is having also the menu in each doc/view. I've tried some idea's, but they all failed. I succeeded in putting a toolbar and status bar, but the menu...arrghhhh!!! X| Do you have any idea's? Thanks in advance, EiSl
Just create new doc/view classes and add new document template in CYourApp::InitInstance:
BOOL CGeNIeApp::InitInstance()
{
...// this template generated by the AppWizard
AddDocTemplate(new CMultiDocTemplate(
IDR_YOURTYPE,
RUNTIME_CLASS(CYourDoc),
RUNTIME_CLASS(CYourFrame),
RUNTIME_CLASS(CYourView)));// new template
AddDocTemplate(new CMultiDocTemplate(
IDR_ANOTHERTYPE,
RUNTIME_CLASS(CAnotherDoc),
RUNTIME_CLASS(CAnotherFrame),
RUNTIME_CLASS(CAnotherView)));
}
...
}Just create the menu with IDR_ANOTHERTYPE and it will be displayed automatically when you switch between views. Tomasz Sowinski -- http://www.shooltz.com