ComPtrRef 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 ComPtrRef Class.

Supports the WRL infrastructure and is not intended to be used directly from your code.

template <  
   typename T  
>  
class ComPtrRef : public ComPtrRefBase<T>;  

Parameters

T
A ComPtr<T> type or a type derived from it, not merely the interface represented by the ComPtr.

Represents a reference to an object of type ComPtr<T>.

Public Constructors

NameDescription
ComPtrRef::ComPtrRef ConstructorInitializes a new instance of the ComPtrRef class from the specified pointer to another ComPtrRef object.

Public Methods

NameDescription
ComPtrRef::GetAddressOf MethodRetrieves the address of a pointer to the interface represented by the current ComPtrRef object.
ComPtrRef::ReleaseAndGetAddressOf MethodDeletes the current ComPtrRef object and returns a pointer-to-a-pointer to the interface that was represented by the ComPtrRef object.

Public Operators

NameDescription
ComPtrRef::operator InterfaceType** OperatorDeletes the current ComPtrRef object and returns a pointer-to-a-pointer to the interface that was represented by the ComPtrRef object.
ComPtrRef::operator T* OperatorReturns the value of the ptr_ data member of the current ComPtrRef object.
ComPtrRef::operator void** OperatorDeletes the current ComPtrRef object, casts the pointer to the interface that was represented by the ComPtrRef object as a pointer-to-pointer-to void, and then returns the cast pointer.
ComPtrRef::operator* OperatorRetrieves the pointer to the interface represented by the current ComPtrRef object.
ComPtrRef::operator== OperatorIndicates whether two ComPtrRef objects are equal.
ComPtrRef::operator!= OperatorIndicates whether two ComPtrRef objects are not equal.

ComPtrRefBase

ComPtrRef

Header: client.h

Namespace: Microsoft::WRL::Details

Microsoft::WRL::Details Namespace

Show: