CComPtr Class Members

Methods

CComPtr Constructor. Initializes the member pointer.
Detach Detaches the member pointer.
Release Decrements the reference count on the object pointed to by the member pointer.
IsEqualObject Compares two objects for equivalence.
Attach Attaches a pointer that already has its reference count incremented.
CopyTo Copies the internal pointer to a target pointer and calls AddRef on the pointer if the copy is successful.
SetSite Sets the site for the internal pointer.
Advise Establishes a connection point with the object pointed to by the smart pointer.
CoCreateInstance Creates an instance of an object in a type-safe manner.
QueryInterface Calls QueryInterface on the internal pointer in a type-safe manner.

Operators

operator T* Converts a CComPtr object to a T*.
operator * Returns the dereferenced value of the member pointer.
operator & Returns the address of the member pointer.
operator -> Returns the member pointer.
operator = Assigns a pointer to the member pointer.
operator ! Returns TRUE or FALSE, depending on whether the member pointer is NULL.
operator < Returns TRUE or FALSE, depending on whether the pointer is less than another pointer.
operator == Compares two pointers for equivalence.

Data Members

p The managed COM interface pointer of type T*.

CComPtr Overview