Redistributing the MFC Library

If you dynamically link your application to the MFC library, you will, at a minimum, have to redistribute Mfc90.dll and Msvcr90.dll with corresponding manifest files for MFC and CRT assemblies. For more information about Visual C++ Assemblies and the DLLs that are part of them, see Visual C++ Libraries as Shared Side-by-Side Assemblies. All MFC DLLs use the shared version of the C run-time library (CRT); therefore, Msvcr90.dll is required.

Mfc90.dll does not have to be redistributed with MFC applications if you statically link to the MFC DLL (that is, if you specified Use MFC in a Static Library on the General tab in the Property Pages dialog box). Even though this may work for testing and internal deployment of your applications, it is not a recommended way to redistribute MFC. For more information about the recommended solution for deploying Visual C++ libraries, see Choosing a Deployment Method.

If your application uses the MFC classes that implement the WebBrowser control (for example, CHtmlView Class or CHtmlEditView Class), Microsoft Internet Explorer 4.0 or a later version must be installed on the target computer. Installing the latest version of Internet Explorer also ensures that the target computer has the latest common control files. Information about how to install minimal Internet Explorer components is available in Knowledge Base article Q185375, HOWTO: Create a Single EXE Install of Internet Explorer.

If your application uses the MFC database classes, such as CRecordset Class and CRecordView Class, you must redistribute ODBC and any ODBC drivers that your application uses. For more information, see Redistributing Database Support Files.

If your MFC application uses Windows Forms controls, you must redistribute mfcmifc90.dll with your application. This DLL is a strong name signed .NET assembly that can be redistributed with an application in an application's local folder or by deploying it into the Global Assembly Cache (GAC) using the Global Assembly Cache Tool (Gacutil.exe).

If you redistribute an MFC DLL, be sure you redistribute the retail version and not the debug version. Debug versions of the DLLs are not redistributable. Debug versions of the MFC DLLs have a trailing "d" in their file names, as in Mfc90d.dll.

If you modify MFC sources in any way and rebuild the MFC DLL, you must rename the modified MFC DLL so that it will not conflict with the MFC DLL from Visual Studio. Rebuilding and renaming the MFC DLL is not a recommended procedure. For more information, see MFC Technical Note 33.

You may redistribute MFC by using either merge modules that are installed with Visual Studio or by deploying the MFC assembly in a sub-folder of your application-local folder as a private assembly. For more information about redistributing MFC, see Redistributing Visual C++ Files.

Installation of Localized MFC Components

If you decide to localize your application's use of the MFC resources by installing an MFC90 localization DLL, you must use the redistributable MSM files. For example, if you want to localize your application on an x86 computer, you must merge the files Microsoft_VC90_MFCLOC_x86.msm and policy_9_0_Microsoft_VC90_MFCLOC_x86.msm into your installation package for an x86 computer.

In addition to the standard catalog, manifest, and policy files, the redistributable MSM files contain a set of 9 DLLs that are used for all localization. The installation process will copy these DLLs the winsxs folder of the target machine.

For more information about localizing MFC applications, search the site for MFC Technical Note 57 and Knowledge Base article Q208983, "How to: Using MFC LOC DLLs".

You can redistribute MFC localized DLLs by deploying the MFC assembly in your application-local folder as a private assembly. For more information about redistributing Visual C++ libraries as private assemblies, see Redistributing Visual C++ Files.

See Also


Redistributing Visual C++ Files