CComModule Class

As of ATL 7.0, CComModule is deprecated: see ATL Module Classes for more details.

Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

class CComModule : public _ATL_MODULE

Members

Public Methods

Name

Description

CComModule::GetClassObject

Creates an object of a specified CLSID. For DLLs only.

CComModule::GetModuleInstance

Returns m_hInst.

CComModule::GetResourceInstance

Returns m_hInstResource.

CComModule::GetTypeLibInstance

Returns m_hInstTypeLib.

CComModule::Init

Initializes data members.

CComModule::RegisterClassHelper

Enters an object's standard class registration in the system registry.

CComModule::RegisterClassObjects

Registers the class object. For EXEs only.

CComModule::RegisterServer

Updates the system registry for each object in the object map.

CComModule::RegisterTypeLib

Registers a type library.

CComModule::RevokeClassObjects

Revokes the class object. For EXEs only.

CComModule::Term

Releases data members.

CComModule::UnregisterClassHelper

Removes an object's standard class registration from the system registry.

CComModule::UnregisterServer

Unregisters each object in the object map.

CComModule::UpdateRegistryClass

Registers or unregisters an object's standard class registration.

CComModule::UpdateRegistryFromResourceD

Runs the script contained in a specified resource to register or unregister an object.

CComModule::UpdateRegistryFromResourceS

Statically links to the ATL Registry Component. Runs the script contained in a specified resource to register or unregister an object.

Public Data Members

Name

Description

CComModule::m_csObjMap

Ensures synchronized access to the object map information.

CComModule::m_csTypeInfoHolder

Ensures synchronized access to the type library information.

CComModule::m_csWindowCreate

Ensures synchronized access to window class information and static data used during window creation.

CComModule::m_hInst

Contains the handle to the module instance.

CComModule::m_hInstResource

By default, contains the handle to the module instance.

CComModule::m_hInstTypeLib

By default, contains the handle to the module instance.

CComModule::m_pObjMap

Points to the object map maintained by the module instance.

Remarks

Note

This class is deprecated, and the ATL code generation wizards now use the CAtlAutoThreadModule and CAtlModule derived classes. See ATL Module Classes for more information. The information that follows is for use with applications created with older releases of ATL. CComModule is still part of ATL for backwards capability.

CComModule implements a COM server module, allowing a client to access the module's components. CComModule supports both DLL (in-process) and EXE (local) modules.

A CComModule instance uses an object map to maintain a set of class object definitions. This object map is implemented as an array of _ATL_OBJMAP_ENTRY structures, and contains information for:

  • Entering and removing object descriptions in the system registry.

  • Instantiating objects through a class factory.

  • Establishing communication between a client and the root object in the component.

  • Performing lifetime management of class objects.

When you run the ATL COM AppWizard, the wizard automatically generates _Module, a global instance of CComModule or a class derived from it. For more information about the ATL Project Wizard, see the article Creating an ATL Project.

In addition to CComModule, ATL provides CComAutoThreadModule, which implements an apartment-model module for EXEs and Windows services. Derive your module from CComAutoThreadModule when you want to create objects in multiple apartments.

Inheritance Hierarchy

_ATL_MODULE

CAtlModule

CAtlModuleT

CComModule

Requirements

Header: atlbase.h

See Also

Other Resources

ATL Class Overview