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. 2 quick questions...

2 quick questions...

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
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.
  • 0 Offline
    0 Offline
    0v3rloader
    wrote on last edited by
    #1

    Hello, I only have two quick questions to ask you and they are: - Can one implement DLLs in VC with MFC support? - How does one do about retrieving the taskbar window handle (HWND or CWnd)? Thanks a lot, David

    A D 2 Replies Last reply
    0
    • 0 0v3rloader

      Hello, I only have two quick questions to ask you and they are: - Can one implement DLLs in VC with MFC support? - How does one do about retrieving the taskbar window handle (HWND or CWnd)? Thanks a lot, David

      A Offline
      A Offline
      Arsalan Malik
      wrote on last edited by
      #2

      How does one do about retrieving the taskbar window handle (HWND or CWnd)?

      HWND hTaskBar = FindWindow("Shell_TrayWnd", NULL);
      

      I am not sure about first question, I think you can probably do it! ARSALAN MALIK

      1 Reply Last reply
      0
      • 0 0v3rloader

        Hello, I only have two quick questions to ask you and they are: - Can one implement DLLs in VC with MFC support? - How does one do about retrieving the taskbar window handle (HWND or CWnd)? Thanks a lot, David

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        dNimrod#X wrote: Can one implement DLLs in VC with MFC support? Yes. Remember that DLLs existed long before MFC came about.


        "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

        0 1 Reply Last reply
        0
        • D David Crow

          dNimrod#X wrote: Can one implement DLLs in VC with MFC support? Yes. Remember that DLLs existed long before MFC came about.


          "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

          0 Offline
          0 Offline
          0v3rloader
          wrote on last edited by
          #4

          That's great! By the way, will I have to take special care about any particular issue(s) related to developing a DLL with MFC support? David

          D 1 Reply Last reply
          0
          • 0 0v3rloader

            That's great! By the way, will I have to take special care about any particular issue(s) related to developing a DLL with MFC support? David

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            With AppWizard, you can create two types of DLL projects: MFC and Win32. With MFC, you can create a:* regular DLL with MFC statically linked

            • regular DLL with shared MFC DLL

            • MFC extension DLL. Search MSDN for examples of each.


              "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

            0 1 Reply Last reply
            0
            • D David Crow

              With AppWizard, you can create two types of DLL projects: MFC and Win32. With MFC, you can create a:* regular DLL with MFC statically linked

              • regular DLL with shared MFC DLL

              • MFC extension DLL. Search MSDN for examples of each.


                "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

              0 Offline
              0 Offline
              0v3rloader
              wrote on last edited by
              #6

              Yeah, I've done that so far. My question had to do more with issues such as: - function declaration; - does MFC act differently when running from a DLL? - will I have to use CProcessLocal globalData (i.e.) to handle dynamic data? And if so, how/when should I use it? I have done a couple of DLLs before, but none had MFC support, so I'm a bit lost out here. I really have no idea how MFC behaves when running from a DLL... Thanks for your patience though! : ) Dave Nimrod

              D 1 Reply Last reply
              0
              • 0 0v3rloader

                Yeah, I've done that so far. My question had to do more with issues such as: - function declaration; - does MFC act differently when running from a DLL? - will I have to use CProcessLocal globalData (i.e.) to handle dynamic data? And if so, how/when should I use it? I have done a couple of DLLs before, but none had MFC support, so I'm a bit lost out here. I really have no idea how MFC behaves when running from a DLL... Thanks for your patience though! : ) Dave Nimrod

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                dNimrod#X wrote: function declaration; Functions are declared the same no matter where they reside. One difference is that exported functions must use __declspec(dllexport) if they are going to be used by other EXEs and DLLs. dNimrod#X wrote: does MFC act differently when running from a DLL? No, but there are precautions that must be taken. For instance, if a function within the DLL will be using a resource that is also contained within the DLL, a call to AFX_MANAGE_STATE() will be required so that the DLL's resource table is looked at rather than the EXE's.


                "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

                0 1 Reply Last reply
                0
                • D David Crow

                  dNimrod#X wrote: function declaration; Functions are declared the same no matter where they reside. One difference is that exported functions must use __declspec(dllexport) if they are going to be used by other EXEs and DLLs. dNimrod#X wrote: does MFC act differently when running from a DLL? No, but there are precautions that must be taken. For instance, if a function within the DLL will be using a resource that is also contained within the DLL, a call to AFX_MANAGE_STATE() will be required so that the DLL's resource table is looked at rather than the EXE's.


                  "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

                  0 Offline
                  0 Offline
                  0v3rloader
                  wrote on last edited by
                  #8

                  Thanks for the invaluable input! You have been really helpful. Dave

                  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