CComQIPtr Class

 

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

A smart pointer class for managing COM interface pointers.

template<class T, const IID* piid= &__uuidof(T)>  
class CComQIPtr: public CComPtr<T>

Parameters

T
A COM interface specifying the type of pointer to be stored.

piid
A pointer to the IID of T.

Public Constructors

NameDescription
CComQIPtr::CComQIPtrConstructor.

Public Operators

NameDescription
CComQIPtr::operator =Assigns a pointer to the member pointer.

ATL uses CComQIPtr and CComPtr to manage COM interface pointers, both of which derive from CComPtrBase. Both classes perform automatic reference counting through calls to AddRef and Release. Overloaded operators handle pointer operations.

CComPtrBase

CComPtr

CComQIPtr

Header: atlcomcli.h

The constructor.

CComQIPtr() throw();
CComQIPtr(T* lp) throw();
CComQIPtr(IUnknown* lp) throw();
CComQIPtr(const CComQIPtr<T, piid>& lp) throw();

Parameters

lp
Used to initialize the interface pointer.

T
A COM interface.

piid
A pointer to the IID of T.

The assignment operator.

T* operator= (T* lp) throw();
T* operator= (const CComQIPtr<T, piid>& lp) throw();
T* operator= (IUnknown* lp) throw();

Parameters

lp
Used to initialize the interface pointer.

T
A COM interface.

piid
A pointer to the IID of T.

Return Value

Returns a pointer to the updated CComQIPtr object.

CComPtr::CComPtr
CComQIPtr::CComQIPtr
CComPtrBase Class
Class Overview
CComQIPtrElementTraits Class

Show: