CWin32Heap Class
TOC
Collapse the table of content
Expand the table of content

CWin32Heap Class

 

This class implements IAtlMemMgr using the Win32 heap allocation functions.

System_CAPS_importantImportant

This class and its members cannot be used in applications that execute in the Windows Runtime.


class CWin32Heap : public IAtlMemMgr

Name

Description

CWin32Heap::CWin32Heap

The constructor.

CWin32Heap::~CWin32Heap

The destructor.

Name

Description

CWin32Heap::Allocate

Allocates a block of memory from the heap object.

CWin32Heap::Attach

Attaches the heap object to an existing heap.

CWin32Heap::Detach

Detaches the heap object from an existing heap.

CWin32Heap::Free

Frees memory previously allocated from the heap.

CWin32Heap::GetSize

Returns the size of a memory block allocated from the heap object.

CWin32Heap::Reallocate

Reallocates a block of memory from the heap object.

Name

Description

CWin32Heap::m_bOwnHeap

A flag used to determine current ownership of the heap handle.

CWin32Heap::m_hHeap

Handle to the heap object.

CWin32Heap implements memory allocation methods using the Win32 heap allocation functions, including HeapAlloc and HeapFree. Unlike other Heap classes, CWin32Heap requires a valid heap handle to be provided before memory is allocated: the other classes default to using the process heap. The handle can be supplied to the constructor or to the CWin32Heap::Attach method. See the CWin32Heap::CWin32Heap method for more details.

Example

See the example for IAtlMemMgr.

IAtlMemMgr

 CWin32Heap

Requirements

Header: atlmem.h

Show:
© 2016 Microsoft