When you first create a project based on the Active Template Library (ATL), you can specify that support for the MFC library classes be added to the project.
To include MFC support in an ATL-based project
class CATL_COMApp : public CWinApp
{
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
};
CATL_COMApp theApp;
BOOL CATL_COMApp::InitInstance()
{
_Module.Init(ObjectMap, m_hInstance, &LIBID_ATL_COMLib);
return CWinApp::InitInstance();
}
int CATL_COMApp::ExitInstance()
{
_Module.Term();
return CWinApp::ExitInstance();
}
You can view the application object class and its InitInstance and ExitInstance functions in ClassView.
See Also Using the ATL COM AppWizard