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

Represents an out-of-memory exception condition.

class CMemoryException : public CSimpleException  

Public Constructors

NameDescription
CMemoryException::CMemoryExceptionConstructs a CMemoryException object.

No further qualification is necessary or possible. Memory exceptions are thrown automatically by new. If you write your own memory functions, using malloc, for example, then you are responsible for throwing memory exceptions.

For more information on CMemoryException, see the article Exception Handling (MFC).

CObject

CException

CSimpleException

CMemoryException

Header: afx.h

Constructs a CMemoryException object.

CMemoryException();  

Remarks

Do not use this constructor directly, but rather call the global function [AfxThrowMemoryException]--brokenlink--(../Topic/not%20found.md#not) _found.md#afxthrowmemoryexception. this global function can succeed in an out-of-memory situation because it constructs the exception object in previously allocated memory. for more information about exception processing, see the article [exceptions](../topic/exception_handling_in_mfc.

CException Class
Hierarchy Chart

Show: