CComObjectNoLock 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 CComObjectNoLock Class.
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
| Name | Description |
|---|---|
| CComObjectNoLock::CComObjectNoLock | Constructor. |
| CComObjectNoLock::~CComObjectNoLock | The destructor. |
Public Methods
| Name | Description |
|---|---|
| CComObjectNoLock::AddRef | Increments the reference count on the object. |
| CComObjectNoLock::QueryInterface | Returns a pointer to the requested interface. |
| CComObjectNoLock::Release | Decrements 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.