Share via


Naming Conventions for MFC DLLs

OverviewHow Do IFAQDetailsSample

The DLLs and libraries included in MFC follow a structured naming convention. This makes it easier to know which DLL or library you should be using for which purpose.

The shared MFC DLL version of MFC comes in a number of different forms. These forms are named according to the convention MFC[O|D|N]x0[U][D].DLL (where x is the MFC version number) as detailed in the following table. The import libraries needed to build applications or extension DLLs that use these DLLs have the same base name as the DLL but have a .LIB extension.

Shared DLL Naming Convention

DLL Description
MFCx0.DLL MFC DLL, ANSI Release version
MFCx0U.DLL MFC DLL, Unicode Release version
MFCx0D.DLL MFC DLL, ANSI Debug version
MFCx0UD.DLL MFC DLL, Unicode Debug version
MFCOx0D.DLL MFC DLL for Active technologies, ANSI Debug version
MFCOx0UD.DLL MFC DLL for Active technologies, Unicode Debug version
MFCDx0D.DLL MFC DLL for database, ANSI Debug version
MFCDx0UD.DLL MFC DLL for database, Unicode Debug version
MFCNx0D.DLL MFC DLL for network (sockets), ANSI Debug version
MFCNx0UD.DLL MFC DLL for network (sockets), Unicode Debug version
MFCSx0.LIB MFC DLL, statically-linked code, Release version
MFCSx0D.LIB MFC DLL, statically-linked code, Debug version

Note   The ActiveX control DLLs OC[D]x0[U][D].DLL are gone. ActiveX control support is now included in the MFC DLL listed in the preceding table.

Note   The MFCSx0[D].LIB libraries are used in conjunction with the DLL versions of MFC. These library files contain code that must be statically linked in the application or DLL.

If you are dynamically linking to the shared DLL version of MFC, whether it is from an application or from an extension DLL, you must include MFCx0.DLL with your product. If you require Unicode support in your application, include MFCx0U.DLL instead.

Note   The MFCx0.DLL and MFCx0U.DLL Retail version of the DLLs contain Active technologies, database, and network support in a single DLL. The Debug version maintains separate DLLs for these functional areas.

If you are statically linking your DLL to MFC, you must link it with one of the static MFC libraries. These versions are named according to the convention [N|U]AFXCW[D].LIB as listed in the following table.

Feature Only in Professional and Enterprise Editions   Static linking to MFC is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

Static-Link Regular DLL Naming Conventions

DLL Description
NAFXCW.LIB MFC Static Link Library, Release version
NAFXCWD.LIB MFC Static Link Library, Debug version
UAFXCW.LIB MFC Static Link Library with Unicode support, Release version
UAFXCWD.LIB MFC Static Link Library with Unicode support, Debug version

Note   In earlier versions of MFC (before version 4.0), there were special DLL variants of the libraries with names in the form [N|U]AFXDW[D].LIB. These variants no longer exist. Use the versions listed in the preceding table.

For a list of DLLs included with Visual C++ that can be distributed with your applications, see the file REDISTRB.WRI in the \OS\System directory on the Visual C++ CD-ROM.

What do you want to know more about?