Replacing my Menu with Default Menu of CFomView
-
Hi all, I want to Replace My Menu which is Created From Resouce -> Menu After creating the Menu at Design Time i have to attach that menu to my CForm View Replacing the Default Menu Item which is created by the MFC Wizard. Please let me know the Process. Because if i comment the Default Menu Created in CMainFrame::OnCreate(...) Member function it is giving error. How to Replace the Existing Default Menu with the New menu Which i have crated in CFormView Only. uday.
-
Hi all, I want to Replace My Menu which is Created From Resouce -> Menu After creating the Menu at Design Time i have to attach that menu to my CForm View Replacing the Default Menu Item which is created by the MFC Wizard. Please let me know the Process. Because if i comment the Default Menu Created in CMainFrame::OnCreate(...) Member function it is giving error. How to Replace the Existing Default Menu with the New menu Which i have crated in CFormView Only. uday.
CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( //IDR_MAINFRAME, Comment this IDR_MENU1, //Give your menu' ID RUNTIME_CLASS(CXXXDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CXXXView)); AddDocTemplate(pDocTemplate);
-
CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( //IDR_MAINFRAME, Comment this IDR_MENU1, //Give your menu' ID RUNTIME_CLASS(CXXXDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CXXXView)); AddDocTemplate(pDocTemplate);
HI, Very Much Thanks to You!!! I have got it. Is is the Same with ToolBar for the CForm View?. uday.
-
HI, Very Much Thanks to You!!! I have got it. Is is the Same with ToolBar for the CForm View?. uday.
If you want to change the toolbar also, then in CMainFrame::OnCreate() replace IDR_MAINFRAME with your toolbar ID. Eg:
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_TOOLBAR1)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create }