CAtlComModule Class

 

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 CAtlComModule Class.

This class implements a COM server module.

class CAtlComModule : public _ATL_COM_MODULE

Public Constructors

NameDescription
CAtlComModule::CAtlComModuleThe constructor.
CAtlComModule::~CAtlComModuleThe destructor.

Public Methods

NameDescription
CAtlComModule::RegisterServerCall this method to update the system registry for each object in the object map.
CAtlComModule::RegisterTypeLibCall this method to register a type library.
CAtlComModule::UnregisterServerCall this method to unregister each object in the object map.
CAtlComModule::UnRegisterTypeLibCall this method to unregister a type library.

CAtlComModule implements a COM server module, allowing a client to access the module's components.

This class replaces the obsolete CComModule class used in earlier versions of ATL. See ATL Module Classes for more details.

_ATL_COM_MODULE

CAtlComModule

Header: atlbase.h

The constructor.

CAtlComModule() throw();

Remarks

Initializes the module.

The destructor.

~CAtlComModule();

Remarks

Frees all class factories.

Call this method to update the system registry for each object in the object map.

HRESULT RegisterServer(BOOL bRegTypeLib = FALSE, const CLSID* pCLSID = NULL);

Parameters

bRegTypeLib
TRUE if the type library is to be registered. The default value is FALSE.

pCLSID
Points to the CLSID of the object to be registered. If NULL (the default value), all objects in the object map will be registered.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Remarks

Calls the global function AtlComModuleRegisterServer.

Call this method to register a type library.

HRESULT RegisterTypeLib(LPCTSTR lpszIndex);
HRESULT RegisterTypeLib();

Parameters

lpszIndex
String in the format "\\N", where N is the integer index of the TYPELIB resource.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Remarks

Adds information about a type library to the system registry. If the module instance contains multiple type libraries, use the first version of this method to specify which type library should be used.

Call this method to unregister each object in the object map.

HRESULT UnregisterServer(
  BOOL bRegTypeLib = FALSE,  
  const CLSID* pCLSID = NULL);

Parameters

bRegTypeLib
TRUE if the type library is to be unregistered. The default value is FALSE.

pCLSID
Points to the CLSID of the object to be unregistered. If NULL (the default value), all objects in the object map will be unregistered.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Remarks

Calls the global function AtlComModuleUnregisterServer.

Call this method to unregister a type library.

HRESULT UnRegisterTypeLib(LPCTSTR lpszIndex);
HRESULT UnRegisterTypeLib();

Parameters

lpszIndex
String in the format "\\N", where N is the integer index of the TYPELIB resource.

Remarks

Removes information about a type library from the system registry. If the module instance contains multiple type libraries, use the first version of this method to specify which type library should be used.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

_ATL_COM_MODULE
Class Overview

Show: