Details of ATL Support Added by the ATL Object Wizard

When ATL support is added (using ATL Object Wizard) to an existing MFC executable or DLL, several modifications are made to the existing MFC project. These modifications are as follows (in this example, the project is called MFCEXE):

Notes for DLL Projects

When you add ATL support to an MFC DLL project, you will see some differences. First, a global variable, _Module, of type CComModule is added. In addition, code is added to the DLLRegisterServer and DLLUnregisterServer functions for registering and unregistering the DLL.

Note   The ATL Object Wizard does not add entries to the DEF file for an MFC DLL. You must add these yourself.

If your project is a DLL COM server, you must export four functions by hand. To accomplish this, add the following to the EXPORTS section of your project's .def file:

DllCanUnloadNow    @1 PRIVATE
DllGetClassObject    @2 PRIVATE
DllRegisterServer    @3 PRIVATE
DllUnregisterServer    @4 PRIVATE