CAtlModuleT Class

This class implements an ATL module.

Syntax

template <class T>
class ATL_NO_VTABLE CAtlModuleT : public CAtlModule

Parameters

T
Your class derived from CAtlModuleT.

Members

Public Constructors

Name Description
CAtlModuleT::CAtlModuleT The constructor.

Public Methods

Name Description
CAtlModuleT::InitLibId Initializes the data member containing the GUID of the current module.
CAtlModuleT::RegisterAppId Adds the EXE to the registry.
CAtlModuleT::RegisterServer Adds the service to the registry.
CAtlModuleT::UnregisterAppId Removes the EXE from the registry.
CAtlModuleT::UnregisterServer Removes the service from the registry.
CAtlModuleT::UpdateRegistryAppId Updates the EXE information in the registry.

Remarks

CAtlModuleT, derived from CAtlModule, implements an Executable (EXE) or a Service (EXE) ATL module. An Executable module is a local, out-of-process server, whereas a Service module is a Windows application that runs in the background when Windows starts.

CAtlModuleT provides support for initializing, registering, and unregistering of the module.

Inheritance Hierarchy

_ATL_MODULE

CAtlModule

CAtlModuleT

Requirements

Header: atlbase.h

CAtlModuleT::CAtlModuleT

The constructor.

CAtlModuleT() throw();

Remarks

Calls CAtlModuleT::InitLibId.

CAtlModuleT::InitLibId

Initializes the data member containing the GUID of the current module.

static void InitLibId() throw();

Remarks

Called by the constructor CAtlModuleT::CAtlModuleT.

CAtlModuleT::RegisterAppId

Adds the EXE to the registry.

HRESULT RegisterAppId() throw();

Return Value

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

CAtlModuleT::RegisterServer

Adds the service to the registry.

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

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.

CAtlModuleT::UnregisterAppId

Removes the EXE from the registry.

HRESULT UnregisterAppId() throw();

Return Value

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

CAtlModuleT::UnregisterServer

Removes the service from the registry.

HRESULT UnregisterServer(
    BOOL bUnRegTypeLib,
    const CLSID* pCLSID = NULL) throw();

Parameters

bUnRegTypeLib
TRUE if the type library is also to be unregistered.

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.

CAtlModuleT::UpdateRegistryAppId

Updates the EXE information in the registry.

static HRESULT WINAPI UpdateRegistryAppId(BOOL /* bRegister*/) throw();

Parameters

bRegister
Reserved.

Return Value

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

See also

CAtlModule Class
Class Overview
Module Classes