Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


second menu bar

Posted on 1999-07-21
Medium Priority
Last Modified: 2013-11-20
I want to put a second menu bar on the mainframe... so I have the main menu, then the button bar, then another menu. How do I go about attaching that second menu to the mainframe?
Question by:cman112398
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 23

Accepted Solution

naveenkohli earned 100 total points
ID: 1310929
Modify your OnCreate function in frame class....Ad memeber variables for each tool bar and create and add them the same way the first one is added... You need to create different resources for all tool bars..

Here is example which adds three toolbars and a dialog bar to main frame....

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
      if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
            return -1;
      // Center the frame window.

      CenterWindow ();

      if (!m_wndToolBar.Create(this) ||
            TRACE0("Failed to create toolbar\n");
            return -1;      // fail to create

      m_wndToolBar.AddDropdownArrow (ID_FILE_OPEN);

      // Create the ToolBar for shapes.

      if (!m_wndShapeToolBar.Create(this,
            TRACE0("Failed to create toolbar\n");
            return -1;      // fail to create

      // Set the caption for the floating tool bar.

      m_wndShapeToolBar.SetWindowText (_T ("Shapes"));

      // Create tool bar for browser.

      if (!m_wndWebToolBar.Create(this,
            TRACE0("Failed to create toolbar\n");
            return -1;      // fail to create

      // Set the caption for the floating tool bar.

      m_wndWebToolBar.SetWindowText (_T ("Browser"));

      if (!m_wndStatusBar.Create(this) ||
            TRACE0("Failed to create status bar\n");
            return -1;      // fail to create

      // Create the dialogbar control.

      if (!m_wndDlgBar.Create (this, IDD_MY_DIALOGBAR, CBRS_TOP, ID_MY_DIALOGBAR)) {
            TRACE (_T ("Failed to create dialog bor!\n"));
            return -1;

      // Set the caption for the floating dialog bar.

      m_wndDlgBar.SetWindowText (_T ("Dialog bar"));

      // TODO: Remove this if you don't want tool tips or a resizeable toolbar

      m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |

      m_wndShapeToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |

      m_wndWebToolBar.SetBarStyle(m_wndWebToolBar.GetBarStyle() |

      m_wndDlgBar.SetBarStyle (m_wndDlgBar.GetBarStyle () |

      // TODO: Delete these three lines if you don't want the toolbar to
      //  be dockable
      m_wndDlgBar.EnableDocking (CBRS_ALIGN_ANY);


      DockControlBar(&m_wndShapeToolBar, AFX_IDW_DOCKBAR_LEFT);
      DockControlBar(&m_wndDlgBar, AFX_IDW_DOCKBAR_LEFT);

DockControlBar(&m_wndWebToolBar, AFX_IDW_DOCKBAR_RIGHT);

      return 0;


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question