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. menu bar

menu bar

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
8 Posts 3 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.
  • A Offline
    A Offline
    aleyah
    wrote on last edited by
    #1

    hi all; I am writting an MFC app using the Doc/View and MDI. My problem is my additional menu bar was grayed and can not click but i dont set it as grayed. And the original menu bar was appear and can click on it. So how to solve this problem.

    J L 2 Replies Last reply
    0
    • A aleyah

      hi all; I am writting an MFC app using the Doc/View and MDI. My problem is my additional menu bar was grayed and can not click but i dont set it as grayed. And the original menu bar was appear and can click on it. So how to solve this problem.

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Maybe it has to do with command update handlers. Have you ON_COMMAND_UPDATE_UI handlers for the new commands in the additional menu bar? (I'm asuming you already have ON_COMMAND handlers for them) Also you might find interesting to have a look at the flag [CFrameWnd::m_bAutoMenuEnable](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cframewnd.3a3a.m_bautomenuenable.asp), which gives you control over this kind of things. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      A 1 Reply Last reply
      0
      • A aleyah

        hi all; I am writting an MFC app using the Doc/View and MDI. My problem is my additional menu bar was grayed and can not click but i dont set it as grayed. And the original menu bar was appear and can click on it. So how to solve this problem.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        When you add new menu item to SDI/MDI MFC application it is disabled in run-time untill you write message handler for this item.

        1 Reply Last reply
        0
        • J Joaquin M Lopez Munoz

          Maybe it has to do with command update handlers. Have you ON_COMMAND_UPDATE_UI handlers for the new commands in the additional menu bar? (I'm asuming you already have ON_COMMAND handlers for them) Also you might find interesting to have a look at the flag [CFrameWnd::m_bAutoMenuEnable](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cframewnd.3a3a.m_bautomenuenable.asp), which gives you control over this kind of things. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

          A Offline
          A Offline
          aleyah
          wrote on last edited by
          #4

          thanks... it's work, but can you tell me how to appear the dialog box after we click the menu bar?????

          J 1 Reply Last reply
          0
          • A aleyah

            thanks... it's work, but can you tell me how to appear the dialog box after we click the menu bar?????

            J Offline
            J Offline
            Joaquin M Lopez Munoz
            wrote on last edited by
            #5

            If I'm understanding your question, you should write something like this on your command handler:

            CYourDialog dlg;
            dlg.DoModal();

            Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

            A 1 Reply Last reply
            0
            • J Joaquin M Lopez Munoz

              If I'm understanding your question, you should write something like this on your command handler:

              CYourDialog dlg;
              dlg.DoModal();

              Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

              A Offline
              A Offline
              aleyah
              wrote on last edited by
              #6

              i do this void CMainFrame::OnLogin() { login dlg; dlg.DoModal(); } but this error appear!! error C2065: 'login' : undeclared identifier error C2146: syntax error : missing ';' before identifier 'dlg' error C2065: 'dlg' : undeclared identifier error C2228: left of '.DoModal' must have class/struct/union type

              J 1 Reply Last reply
              0
              • A aleyah

                i do this void CMainFrame::OnLogin() { login dlg; dlg.DoModal(); } but this error appear!! error C2065: 'login' : undeclared identifier error C2146: syntax error : missing ';' before identifier 'dlg' error C2065: 'dlg' : undeclared identifier error C2228: left of '.DoModal' must have class/struct/union type

                J Offline
                J Offline
                Joaquin M Lopez Munoz
                wrote on last edited by
                #7

                mmmh... What is that login? It is a CDialog class, right? Then in your project you'll see a .cpp and a .h (possibly login.h) files associated with the class. Include this line at the beggining of the file where the error is:

                #include "login.h" // or whatever the header file for the class is named

                You know, this is pretty basic C/C++ stuff. Maybe you should spend some time reading some C/C++ primer to get the fundamentals learnt. Do a search on Internet, there must be plenty of tutorials. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                A 1 Reply Last reply
                0
                • J Joaquin M Lopez Munoz

                  mmmh... What is that login? It is a CDialog class, right? Then in your project you'll see a .cpp and a .h (possibly login.h) files associated with the class. Include this line at the beggining of the file where the error is:

                  #include "login.h" // or whatever the header file for the class is named

                  You know, this is pretty basic C/C++ stuff. Maybe you should spend some time reading some C/C++ primer to get the fundamentals learnt. Do a search on Internet, there must be plenty of tutorials. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                  A Offline
                  A Offline
                  aleyah
                  wrote on last edited by
                  #8

                  thanks... can you help me to solve my above problem... (c and visual c++)

                  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