Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Replacing my Menu with Default Menu of CFomView

Replacing my Menu with Default Menu of CFomView

Scheduled Pinned Locked Moved C / C++ / MFC
c++designhelptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uday Janaswamy
    wrote on last edited by
    #1

    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.

    D 1 Reply Last reply
    0
    • U Uday Janaswamy

      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.

      D Offline
      D Offline
      Dreamz
      wrote on last edited by
      #2

      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);

      U 1 Reply Last reply
      0
      • D Dreamz

        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);

        U Offline
        U Offline
        Uday Janaswamy
        wrote on last edited by
        #3

        HI, Very Much Thanks to You!!! I have got it. Is is the Same with ToolBar for the CForm View?. uday.

        D 1 Reply Last reply
        0
        • U Uday Janaswamy

          HI, Very Much Thanks to You!!! I have got it. Is is the Same with ToolBar for the CForm View?. uday.

          D Offline
          D Offline
          Dreamz
          wrote on last edited by
          #4

          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 }

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups