Details of ATL Support Added by the ATL Wizard
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Details of ATL Support Added by the ATL Wizard.
When you add ATL support to an existing MFC executable or DLL, Visual C++ makes the following modifications to the existing MFC project (in this example, the project is called MFCEXE
):
Two new files (an .idl file and an .rgs file, used to register the server) are added.
In the main application header and implementation files (Mfcexe.h and Mfcexe.cpp), a new class (derived from CAtlMFCModule) is added. In addition to the new class, code is added to
InitInstance
for registration. Code is also added to theExitInstance
function for revoking the class object. In the header file, Finally, two new header files (Initguid.h and Mfcexe_i.c) are included in the implementation file, declaring and initializing the new GUIDs for the CAtlMFCModule-derived class.To register the server properly, an entry for the new .rgs file is added to the project's resource file.
Notes for DLL Projects
When you add ATL support to an MFC DLL project, you will see some differences. Code is added to the DLLRegisterServer and DLLUnregisterServer functions for registering and unregistering the DLL. Code is also added to DllCanUnloadNow and DllGetClassObject.
See Also
ATL Support in an MFC Project
Adding Functionality with Code Wizards
Adding a Class
Adding a Member Function
Adding a Member Variable
Overriding a Virtual Function
MFC Message Handler
Navigating the Class Structure