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. ON_COMMAND macro in MFC - opinions / explanations please.

ON_COMMAND macro in MFC - opinions / explanations please.

Scheduled Pinned Locked Moved C / C++ / MFC
c++discussion
14 Posts 6 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.
  • V Vaclav_

    Ok, nice catch and just for you - "Win32 Static Libray". Now back to OP.

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

    Vaclav_Sal wrote:

    and just for you

    No, it's for everyone, because there are important and fundamental differences in how a static library and a DLL are connected to the executable. And that affects how your problem occurs and how it may be resolved.

    M E 2 Replies Last reply
    0
    • L Lost User

      Vaclav_Sal wrote:

      and just for you

      No, it's for everyone, because there are important and fundamental differences in how a static library and a DLL are connected to the executable. And that affects how your problem occurs and how it may be resolved.

      M Offline
      M Offline
      mistletoe_dean
      wrote on last edited by
      #5

      LIB + DLL + .H . I think you should add you Dll,lib and .H in you Debug folder . Then you can use it just like a class. you can try !

      A 1 Reply Last reply
      0
      • M mistletoe_dean

        LIB + DLL + .H . I think you should add you Dll,lib and .H in you Debug folder . Then you can use it just like a class. you can try !

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #6

        You just posted that to Richard...

        M 1 Reply Last reply
        0
        • V Vaclav_

          This is puzzling me. I can add menu item with system generated and #define(d) ID and the menu text will be grayed out until I add a function to process the ON_COMMAND macro. However, I have a static DLL which has just the #define(s) IDs and if I use the ID in MFC OnCommand function ( WPARAM) – in case switch – the menu will be active. The way it looks – if the ID is defined in DLL the menu is OK, but if “locally” it needs the function in ON_COMMAND macro and than the OnCommand function is not used. If this is normal , OK Thanks for your time. Cheers Vaclav

          A Offline
          A Offline
          Albert Holguin
          wrote on last edited by
          #7

          Not sure I follow what you're saying... elaborate a bit perhaps?

          1 Reply Last reply
          0
          • A Albert Holguin

            You just posted that to Richard...

            M Offline
            M Offline
            Malli_S
            wrote on last edited by
            #8

            CP seems to be new to him...

            [Delegates]      [Virtual Desktop]      [Tray Me !]
            -Malli...! :rose:****

            1 Reply Last reply
            0
            • L Lost User

              Vaclav_Sal wrote:

              and just for you

              No, it's for everyone, because there are important and fundamental differences in how a static library and a DLL are connected to the executable. And that affects how your problem occurs and how it may be resolved.

              E Offline
              E Offline
              Erudite_Eric
              wrote on last edited by
              #9

              Stick to the point Richard.

              L 1 Reply Last reply
              0
              • V Vaclav_

                This is puzzling me. I can add menu item with system generated and #define(d) ID and the menu text will be grayed out until I add a function to process the ON_COMMAND macro. However, I have a static DLL which has just the #define(s) IDs and if I use the ID in MFC OnCommand function ( WPARAM) – in case switch – the menu will be active. The way it looks – if the ID is defined in DLL the menu is OK, but if “locally” it needs the function in ON_COMMAND macro and than the OnCommand function is not used. If this is normal , OK Thanks for your time. Cheers Vaclav

                E Offline
                E Offline
                Erudite_Eric
                wrote on last edited by
                #10

                Vaclav_Sal wrote:

                if the ID is defined in DLL

                It cant be defined in a dll, it must be defined in a header file to have any meaning in your app. Don't really get what you mean though.

                1 Reply Last reply
                0
                • E Erudite_Eric

                  Stick to the point Richard.

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

                  What? The point is that much of the question makes no sense.

                  1 Reply Last reply
                  0
                  • V Vaclav_

                    This is puzzling me. I can add menu item with system generated and #define(d) ID and the menu text will be grayed out until I add a function to process the ON_COMMAND macro. However, I have a static DLL which has just the #define(s) IDs and if I use the ID in MFC OnCommand function ( WPARAM) – in case switch – the menu will be active. The way it looks – if the ID is defined in DLL the menu is OK, but if “locally” it needs the function in ON_COMMAND macro and than the OnCommand function is not used. If this is normal , OK Thanks for your time. Cheers Vaclav

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

                    Hi, This is completely normal in MFC from a CFrameWnd derived class. This behavior is governed by the variable CFrameWnd::m_bAutoMenuEnable[^]. Best Wishes, -David Delaune

                    V 1 Reply Last reply
                    0
                    • L Lost User

                      Hi, This is completely normal in MFC from a CFrameWnd derived class. This behavior is governed by the variable CFrameWnd::m_bAutoMenuEnable[^]. Best Wishes, -David Delaune

                      V Offline
                      V Offline
                      Vaclav_
                      wrote on last edited by
                      #13

                      Thanks David. I will try to clean up my code - it seems silly to intercept the menu message using ON_COMMAND macro and "re post" same message so OnCommand can process it. It really does not matter, to me, where the menu message gets processed, but since I started using libraries / modules I was just rying to keep processing uniform and under one function. It was dissapointing that majority of replies managed to stay off the subject. Cheers Vaclav

                      L 1 Reply Last reply
                      0
                      • V Vaclav_

                        Thanks David. I will try to clean up my code - it seems silly to intercept the menu message using ON_COMMAND macro and "re post" same message so OnCommand can process it. It really does not matter, to me, where the menu message gets processed, but since I started using libraries / modules I was just rying to keep processing uniform and under one function. It was dissapointing that majority of replies managed to stay off the subject. Cheers Vaclav

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

                        Vaclav_Sal wrote:

                        It was dissapointing that majority of replies managed to stay off the subject.

                        It was disappointing that your original question was so confusing.

                        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