Is it possible to recompile MFC source code to some dlls?
-
In VS install directory, there're some files(.cpp, .h) seems to be source code of MFC. So can I put them back into VC and compile them?
-
In VS install directory, there're some files(.cpp, .h) seems to be source code of MFC. So can I put them back into VC and compile them?
You can. But you really shouldn't do it unless you have a very good reason to do so. And I can't think of a good reason to. If you want to change the behavior of some class, just subclass it and handle it in that good old C++ way...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)
-
You can. But you really shouldn't do it unless you have a very good reason to do so. And I can't think of a good reason to. If you want to change the behavior of some class, just subclass it and handle it in that good old C++ way...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)
Oh...I'd like to have a try. Just to know MFC libray better. So are there any instructions about compiling MFC source code on the internet?
-
Oh...I'd like to have a try. Just to know MFC libray better. So are there any instructions about compiling MFC source code on the internet?
I'm not sure how building the library yourself will help you "know MFC libray better", but... Take a look in the atl/mfc src directory. For example, in VS 2005, there's a readme.txt that states:
Building ATL and MFC
To build either ATL or MFC open a command prompt and run vcvars32.bat from \bin
Change directory to \atlmfc\srcatlmfc.mak can be used to rebuild all ATL and MFC libraries and DLLs.
Following is the command line you can specify with NMAKEnmake /f atlmfc.mak [ALL | ATL | MFC] [CLEAN= ] [LIBNAME= ] [PLATFORM= ]
Targets ALL - builds both ATL and MFC. This is the default target. LIBNAME has to be
specified.
ATL - builds only ATL.
MFC - builds only MFC. LIBNAME has to be specified.CLEAN=1 cleans the files generated by the specified targets LIBNAME="name of the MFCdll being built" - specifying MFC80 builds the prebuilt DLLs PLATFORM=\[AMD64|IA64\] if building for 64-bit on a 32-bit system
Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."
-
I'm not sure how building the library yourself will help you "know MFC libray better", but... Take a look in the atl/mfc src directory. For example, in VS 2005, there's a readme.txt that states:
Building ATL and MFC
To build either ATL or MFC open a command prompt and run vcvars32.bat from \bin
Change directory to \atlmfc\srcatlmfc.mak can be used to rebuild all ATL and MFC libraries and DLLs.
Following is the command line you can specify with NMAKEnmake /f atlmfc.mak [ALL | ATL | MFC] [CLEAN= ] [LIBNAME= ] [PLATFORM= ]
Targets ALL - builds both ATL and MFC. This is the default target. LIBNAME has to be
specified.
ATL - builds only ATL.
MFC - builds only MFC. LIBNAME has to be specified.CLEAN=1 cleans the files generated by the specified targets LIBNAME="name of the MFCdll being built" - specifying MFC80 builds the prebuilt DLLs PLATFORM=\[AMD64|IA64\] if building for 64-bit on a 32-bit system
Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."
Very long time ago, I just wondered why doesn't MFC add all Windows message handlers to CWnd and make them all virtual, so that derived classed don't need to add message handlers but only to override virtual functions. MFC claims that it uses message maps rather than virtual functions just in order to tune the performance, now it's time to tell the real difference. ;-)
-
Very long time ago, I just wondered why doesn't MFC add all Windows message handlers to CWnd and make them all virtual, so that derived classed don't need to add message handlers but only to override virtual functions. MFC claims that it uses message maps rather than virtual functions just in order to tune the performance, now it's time to tell the real difference. ;-)
Cool. Let us know the results! From Technical Note TN006: "Microsoft Windows implements what are essentially virtual functions in window classes using its messaging facility. Due to the large number of messages involved, providing a separate virtual function for each Windows message results in a prohibitively large vtable. Also, since the number of system-defined Windows messages changes over time, and since a specific application may want to define some Windows messages of its own, the message-map mechanism provides a level of indirection that prevents interface changes from breaking existing code."
Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."