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