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. Removing MFC dependancy in MFC Extenstion DLL

Removing MFC dependancy in MFC Extenstion DLL

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestiondiscussion
7 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.
  • N Offline
    N Offline
    Nishad S
    wrote on last edited by
    #1

    What are the possibilities to remove the MFC dependency, from an MFC extension DLL? Means, the interface class cannot have MFC dependency, but no need to remove MFC from internal code (functionality side). I believe it is not possible, but i would like to know your opinions :) For example, my extension dll has a custom button (named CCustomBtn) derived from CButton. In the client side, CCustomBtn is used to create control variable for the button to get the custom look and feel. So what I need is, avoid the MFC dependancy from this CCustomBtn class (and in the include header), with/without affecting the client side. ('without affecting' is preferred, but i think it is impossible) Please share your ideas. Thank you.

    - NS -

    M M 2 Replies Last reply
    0
    • N Nishad S

      What are the possibilities to remove the MFC dependency, from an MFC extension DLL? Means, the interface class cannot have MFC dependency, but no need to remove MFC from internal code (functionality side). I believe it is not possible, but i would like to know your opinions :) For example, my extension dll has a custom button (named CCustomBtn) derived from CButton. In the client side, CCustomBtn is used to create control variable for the button to get the custom look and feel. So what I need is, avoid the MFC dependancy from this CCustomBtn class (and in the include header), with/without affecting the client side. ('without affecting' is preferred, but i think it is impossible) Please share your ideas. Thank you.

      - NS -

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      If you have a class derived from an MFC class then everywhere you use that class will have a dependency on MFC.

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      N 1 Reply Last reply
      0
      • N Nishad S

        What are the possibilities to remove the MFC dependency, from an MFC extension DLL? Means, the interface class cannot have MFC dependency, but no need to remove MFC from internal code (functionality side). I believe it is not possible, but i would like to know your opinions :) For example, my extension dll has a custom button (named CCustomBtn) derived from CButton. In the client side, CCustomBtn is used to create control variable for the button to get the custom look and feel. So what I need is, avoid the MFC dependancy from this CCustomBtn class (and in the include header), with/without affecting the client side. ('without affecting' is preferred, but i think it is impossible) Please share your ideas. Thank you.

        - NS -

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        My MFC is rusty, but IIRC MFC extension DLLs must link with the DLL version of MFC. So basically, you can't do what you're asking for.

        --Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen

        N 1 Reply Last reply
        0
        • M Mark Salsbery

          If you have a class derived from an MFC class then everywhere you use that class will have a dependency on MFC.

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          N Offline
          N Offline
          Nishad S
          wrote on last edited by
          #4

          Yes. But my requirement is to use the same dll for both old vc6 projects and for new vc8/9 projects. So there is an option to avoid the MFC dependency. As far as I know, extension dll should be compiled using the same compiler and libraries those are to be used for the client side. So if there is a chance to avoid the MFC dependency with out degrading the functionality of the MFC extension dll, my requirement is satisfied.

          - NS - [ODBaseBtn]

          M 1 Reply Last reply
          0
          • M Michael Dunn

            My MFC is rusty, but IIRC MFC extension DLLs must link with the DLL version of MFC. So basically, you can't do what you're asking for.

            --Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen

            N Offline
            N Offline
            Nishad S
            wrote on last edited by
            #5

            Yes. But my requirement is to use the same dll for both old vc6 projects and for new vc8/9 projects. So there is an option to avoid the MFC dependency. As far as I know, extension dll should be compiled using the same compiler and libraries those are to be used for the client side. So if there is a chance to avoid the MFC dependency with out degrading the functionality of the MFC extension dll, my requirement is satisfied.

            - NS - [ODBaseBtn]

            1 Reply Last reply
            0
            • N Nishad S

              Yes. But my requirement is to use the same dll for both old vc6 projects and for new vc8/9 projects. So there is an option to avoid the MFC dependency. As far as I know, extension dll should be compiled using the same compiler and libraries those are to be used for the client side. So if there is a chance to avoid the MFC dependency with out degrading the functionality of the MFC extension dll, my requirement is satisfied.

              - NS - [ODBaseBtn]

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              I see two choices: 1) Don't use MFC in the DLL. 2) Make the DLL a "regular DLL" Linked to MFC Option 1 may not be an option. Option 2 may require significant changes to the App-DLL interface. Kinds of DLLs[^]

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              N 1 Reply Last reply
              0
              • M Mark Salsbery

                I see two choices: 1) Don't use MFC in the DLL. 2) Make the DLL a "regular DLL" Linked to MFC Option 1 may not be an option. Option 2 may require significant changes to the App-DLL interface. Kinds of DLLs[^]

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                N Offline
                N Offline
                Nishad S
                wrote on last edited by
                #7

                Thank you. I think I have to stick on the Extension DLL and provide a different one compiled with VC8/9 for newer applications.

                - NS - [ODBaseBtn]

                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