Retrieves a pointer to the default OLE task memory allocator (which supports the system implementation of the IMalloc interface) so applications can call its methods to manage memory.
HRESULT CoGetMalloc(
DWORD dwMemContext, //Indicates if memory is private or shared
LPMALLOC * ppMalloc //Address of output variable that receives a
// pointer to the memory allocator
);
This function supports the standard return values E_INVALIDARG and E_OUTOFMEMORY, as well as the following:
The pointer to the IMalloc interface pointer received through the ppMalloc parameter cannot be used from a remote process—each process must have its own allocator.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objbase.h.
Import Library: Included as a resource in ole32.dll.