CComObjectNoLock Class

 

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

This class implements IUnknown for a nonaggregated object, but does not increment the module lock count in the constructor.

template<class Base>  
class CComObjectNoLock : public Base

Parameters

Base
Your class, derived from CComObjectRoot or CComObjectRootEx, as well as from any other interface you want to support on the object.

Public Constructors

NameDescription
CComObjectNoLock::CComObjectNoLockConstructor.
CComObjectNoLock::~CComObjectNoLockThe destructor.

Public Methods

NameDescription
CComObjectNoLock::AddRefIncrements the reference count on the object.
CComObjectNoLock::QueryInterfaceReturns a pointer to the requested interface.
CComObjectNoLock::ReleaseDecrements the reference count on the object.

CComObjectNoLock is similar to CComObject in that it implements IUnknown for a nonaggregated object; however, CComObjectNoLock does not increment the module lock count in the constructor.

ATL uses CComObjectNoLock internally for class factories. In general, you will not use this class directly.

Base

CComObjectNoLock

Header: atlcom.h

Increments the reference count on the object.

STDMETHOD_(ULONG, AddRef)();

Return Value

A value that may be useful for diagnostics or testing.

The constructor. Unlike CComObject, does not increment the module lock count.

CComObjectNoLock(void* = NULL);

Parameters

void*
[in] This unnamed parameter is not used. It exists for symmetry with other CComXXXObjectXXX constructors.

The destructor.

~CComObjectNoLock();

Remarks

Frees all allocated resources and calls FinalRelease.

Retrieves a pointer to the requested interface.

STDMETHOD(QueryInterface)(REFIID iid, void** ppvObject);

Parameters

iid
[in] The identifier of the interface being requested.

ppvObject
[out] A pointer to the interface pointer identified by iid. If the object does not support this interface, ppvObject is set to NULL.

Return Value

A standard HRESULT value.

Decrements the reference count on the object.

STDMETHOD_(ULONG, Release)();

Return Value

In debug builds, Release returns a value that may be useful for diagnostics or testing. In non-debug builds, Release always returns 0.

Class Overview

Show: