CAtlDllModuleT Class

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

This class represents the module for a DLL.

template <class T>  
class ATL_NO_VTABLE CAtlDllModuleT : public CAtlModuleT<T>

Parameters

T
Your class derived from CAtlDllModuleT.

Public Constructors

NameDescription
CAtlDllModuleT::CAtlDllModuleTThe constructor.
CAtlDllModuleT::~CAtlDllModuleTThe destructor.

Public Methods

NameDescription
CAtlDllModuleT::DllCanUnloadNowTests if the DLL can be unloaded.
CAtlDllModuleT::DllGetClassObjectReturns a class factory.
CAtlDllModuleT::DllMainThe optional entry point into a dynamic-link library (DLL).
CAtlDllModuleT::DllRegisterServerAdds entries to the system registry for objects in the DLL.
CAtlDllModuleT::DllUnregisterServerRemoves entries in the system registry for objects in the DLL.
CAtlDllModuleT::GetClassObjectReturns a class factory. Invoked by DllGetClassObject.

CAtlDllModuleT represents the module for a dynamic-link library (DLL) and provides functions used by all DLL projects. This specialization of CAtlModuleT class includes support for registration.

For more information on modules in ATL, see ATL Module Classes.

_ATL_MODULE

CAtlModule

CAtlModuleT

CAtlDllModuleT

Header: atlbase.h

The constructor.

CAtlDllModuleT() throw();

The destructor.

~CAtlDllModuleT() throw();

Tests if the DLL can be unloaded.

HRESULT DllCanUnloadNow() throw();

Return Value

Returns S_OK if the DLL can be unloaded, or S_FALSE if it cannot.

Returns the class factory.

HRESULT DllGetClassObject(
    REFCLSID rclsid,
    REFIID riid,
    LPVOID* ppv) throw();

Parameters

rclsid
The CLSID of the object to be created.

riid
The IID of the requested interface.

ppv
A pointer to the interface pointer identified by riid. If the object does not support this interface, ppv is set to NULL.

Return Value

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

The optional entry point into a dynamic-link library (DLL).

BOOL WINAPI DllMain(DWORD dwReason, LPVOID /* lpReserved*/) throw();

Parameters

dwReason
If set to DLL_PROCESS_ATTACH, the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls are disabled.

lpReserved
Reserved.

Return Value

Always returns TRUE.

Remarks

Disabling the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls can be a useful optimization for multithreaded applications that have many DLLs, that frequently create and delete threads, and whose DLLs do not need these thread-level notifications of attachment/detachment.

Adds entries to the system registry for objects in the DLL.

HRESULT DllRegisterServer(BOOL bRegTypeLib = TRUE) throw();

Parameters

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

Return Value

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

Removes entries in the system registry for objects in the DLL.

HRESULT DllUnregisterServer(BOOL bUnRegTypeLib = TRUE) throw();

Parameters

bUnRegTypeLib
TRUE if the type library is to be removed from the registry. The default value is TRUE.

Return Value

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

Creates an object of the specified CLSID.

HRESULT GetClassObject(
    REFCLSID rclsid,
    REFIID riid,
    LPVOID* ppv) throw();

Parameters

rclsid
The CLSID of the object to be created.

riid
The IID of the requested interface.

ppv
A pointer to the interface pointer identified by riid. If the object does not support this interface, ppv is set to NULL.

Return Value

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

Remarks

This method is called by CAtlDllModuleT::DllGetClassObject and is included for backward compatibility.

CAtlModuleT Class
CAtlExeModuleT Class
Class Overview
Module Classes

Show: