Creates a smart pointer type that represents the interface specified by the template parameter. ComPtr automatically maintains a reference count for the underlying interface pointer and releases the interface when the reference count goes to zero.
template < typename T > class ComPtr; template< class U > friend class ComPtr;
ComPtr<> declares a type that represents the underlying interface pointer. Use ComPtr<> to declare a variable and then use the arrow member-access operator (->) to access an interface member function.
For more information about smart pointers, see the "COM Smart Pointers" subsection of the COM Coding Practices topic in the MSDN Library.
|
Name |
Description |
|---|---|
|
Returns a ComPtr object that represents the interface identified by the specified template parameter. |
|
|
Returns a ComPtr object that represents the interface identified by the specified interface ID. |
|
|
Retrieves a weak reference to the current object. |
|
|
Associates this ComPtr with the interface type specified by the current template type parameter. |
|
|
Copies the current or specified interface associated with this ComPtr to the specified output pointer. |
|
|
Disassociates this ComPtr from the interface that it represents. |
|
|
Retrieves a pointer to the interface that is associated with this ComPtr. |
|
|
Retrieves the address of the ptr_ data member, which contains a pointer to the interface represented by this ComPtr. |
|
|
Releases the interface associated with this ComPtr and then retrieves the address of the ptr_ data member, which contains a pointer to the interface that was released. |
|
|
Exchanges the interface managed by the current ComPtr with the interface managed by the specified ComPtr. |
|
Name |
Description |
|---|---|
|
Indicates whether or not a ComPtr is managing the object lifetime of an interface. |
|
|
Retrieves the address of the current ComPtr. |
|
|
Assigns a value to the current ComPtr. |
|
|
Retrieves a pointer to the type specified by the current template parameter. |
|
|
Indicates whether two ComPtr objects are equal. |
|
|
Indicates whether two ComPtr objects are not equal. |