Compartilhar via


CComPtrBase Class

This class provides a basis for smart pointer classes using COM-based memory routines.

template < 
   class T  
> class CComPtrBase

Parameters

  • T
    The object type to be referenced by the smart pointer.

Members

Public Constructors

Name

Description

CComPtrBase::~CComPtrBase

The destructor.

Public Methods

Name

Description

CComPtrBase::Advise

Call this method to create a connection between the CComPtrBase's connection point and a client's sink.

CComPtrBase::Attach

Call this method to take ownership of an existing pointer.

CComPtrBase::CoCreateInstance

Call this method to create an object of the class associated with a specified Class ID or Program ID.

CComPtrBase::CopyTo

Call this method to copy the CComPtrBase pointer to another pointer variable.

CComPtrBase::Detach

Call this method to release ownership of a pointer.

CComPtrBase::IsEqualObject

Call this method to check if the specified IUnknown points to the same object associated with the CComPtrBase object.

CComPtrBase::QueryInterface

Call this method to return a pointer to a specified interface.

CComPtrBase::Release

Call this method to release the interface.

CComPtrBase::SetSite

Call this method to set the site of the CComPtrBase object to the IUnknown of the parent object.

Public Operators

Name

Description

CComPtrBase::operator T*

The cast operator.

CComPtrBase::operator !

The NOT operator.

CComPtrBase::operator &

The & operator.

CComPtrBase::operator *

The * operator.

CComPtrBase::operator <

The less-than operator.

CComPtrBase::operator ==

The equality operator.

CComPtrBase::operator ->

The pointer-to-members operator.

Public Data Members

Name

Description

CComPtrBase::p

The pointer data member variable.

Remarks

This class provides the basis for other smart pointers which use COM memory management routines, such as CComQIPtr and CComPtr. The derived classes add their own constructors and operators, but rely on the methods provided by CComPtrBase.

Requirements

Header: atlcomcli.h

See Also

Other Resources

ATL Class Overview