共用方式為


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

A smart pointer class for managing heap pointers.

Syntax

template<typename T>  
class CComHeapPtr : public CHeapPtr<T, CComAllocator>

Parameters

T
The object type to be stored on the heap.

Members

Public Constructors

Name Description
CComHeapPtr::CComHeapPtr The constructor.

Remarks

CComHeapPtr derives from CHeapPtr, but uses CComAllocator to allocate memory using COM routines. See CHeapPtr and CHeapPtrBase for the methods available.

Inheritance Hierarchy

CHeapPtrBase

CHeapPtr

CComHeapPtr

Requirements

Header: atlbase.h

CComHeapPtr::CComHeapPtr

The constructor.

CComHeapPtr() throw();
explicit CComHeapPtr(T* pData) throw();

Parameters

pData
An existing CComHeapPtr object.

Remarks

The heap pointer can optionally be created using an existing CComHeapPtr object. If so, the new CComHeapPtr object assumes responsibility for managing the new pointer and resources.

See Also

CHeapPtr Class
CHeapPtrBase Class
CComAllocator Class
Class Overview