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. Add menu in ChilFrame.

Add menu in ChilFrame.

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
2 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.
  • L Offline
    L Offline
    lavate malllik
    wrote on last edited by
    #1

    Iam having a MDI application. I have two queris. 1. How to add the menu in childframe 2. For different child how i can add the different menu. Thanks in davance. Regards Lavate Mallikarjun Avanna

    N 1 Reply Last reply
    0
    • L lavate malllik

      Iam having a MDI application. I have two queris. 1. How to add the menu in childframe 2. For different child how i can add the different menu. Thanks in davance. Regards Lavate Mallikarjun Avanna

      N Offline
      N Offline
      Nelek
      wrote on last edited by
      #2

      In one project I used different Views with different Menus according to which was the active one. I did it creating the menus in the resource editor and then in the MyApp files (.h and .cpp) creating different CMultiDocTemplate one for each type of view, saying which menu was owned by which view.

      BOOL CFPSApp::InitInstance()
      {
      AfxEnableControlContainer();

      .
      .
      //more code
      .
      .
      //Main window menu
      pDocTemplate = new CMultiDocTemplate(
      IDR_FPSIITYPE,
      RUNTIME_CLASS(CFPSDoc),
      RUNTIME_CLASS(CChildFrame), // Benutzerspezifischer MDI-Child-Rahmen
      RUNTIME_CLASS(CFPSView));
      AddDocTemplate(pDocTemplate);
      .
      //One of the child menu
      pParamRegMatTemplate = new CMultiDocTemplate(
      IDR_VIEWTYPE, //Special menu for the view
      RUNTIME_CLASS(CFPSDoc),
      RUNTIME_CLASS(CChildFrame), //Some special features for the view
      RUNTIME_CLASS(CParamRegView)); //View for the Regler
      AddDocTemplate(pParamRegMatTemplate);
      .
      //More code
      }

      this option is good when you know for sure how your project is going to be structured. There are other options to load/unload menus dinamically. If you use it you will have to load/unload the menu in the OnInitialUpdate and when your view loses and wins the focus another time. With the other way I have explained all is done automatically.

      Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson Rating helpfull answers is nice, but saying thanks can be even nicer.

      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