CAtlBaseModule Class

 

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

This class is instantiated in every ATL project.

class CAtlBaseModule : public _ATL_BASE_MODULE

Public Constructors

NameDescription
CAtlBaseModule::CAtlBaseModuleThe constructor.

Public Methods

NameDescription
CAtlBaseModule::AddResourceInstanceAdds a resource instance to the list of stored handles.
CAtlBaseModule::GetHInstanceAtReturns a handle to a specified resource instance.
CAtlBaseModule::GetModuleInstanceReturns the module instance from a CAtlBaseModule object.
CAtlBaseModule::GetResourceInstanceReturns the resource instance from a CAtlBaseModule object.
CAtlBaseModule::RemoveResourceInstanceRemoves a resource instance from the list of stored handles.
CAtlBaseModule::SetResourceInstanceSets the resource instance of a CAtlBaseModule object.

Public Data Members

NameDescription
CAtlBaseModule::m_bInitFailedA variable that indicates if the module initialization has failed.

An instance of CAtlBaseModule named _AtlBaseModule is present in every ATL project, containing a handle to the module instance, a handle to the module containing resources (which by default, are one and the same), and an array of handles to modules providing primary resources. CAtlBaseModule can be safely accessed from multiple threads.

This class replaces the obsolete CComModule class used in earlier versions of ATL.

_ATL_BASE_MODULE

CAtlBaseModule

Header: atlcore.h

Adds a resource instance to the list of stored handles.

bool AddResourceInstance(HINSTANCE hInst) throw();

Parameters

hInst
The resource instance to add.

Return Value

Returns true if the resource was successfully added, false otherwise.

The constructor.

CAtlBaseModule() throw();

Remarks

Creates the CAtlBaseModule.

Returns a handle to a specified resource instance.

HINSTANCE GetHInstanceAt(int i) throw();

Parameters

i
The number of the resource instance.

Return Value

Returns the handle to the resource instance, or NULL if no corresponding resource instance exists.

Returns the module instance from a CAtlBaseModule object.

HINSTANCE GetModuleInstance() throw();

Return Value

Returns the module instance.

Returns the resource instance.

HINSTANCE GetResourceInstance() throw();

Return Value

Returns the resource instance.

A variable that indicates if the module initialization has failed.

static bool m_bInitFailed;

Remarks

True if the module initialized, false if it failed to initialize.

Removes a resource instance from the list of stored handles.

bool RemoveResourceInstance(HINSTANCE hInst) throw();

Parameters

hInst
The resource instance to remove.

Return Value

Returns true if the resource was successfully removed, false otherwise.

Sets the resource instance of a CAtlBaseModule object.

HINSTANCE SetResourceInstance(HINSTANCE hInst) throw();

Parameters

hInst
The new resource instance.

Return Value

Returns the updated resource instance.

Class Overview
Module Classes

Show: