|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Sets a hook that enables calling of the specified function before each memory block is allocated.
The Microsoft Foundation Class Library debug-memory allocator can call a user-defined hook function to allow the user to monitor a memory allocation and to control whether the allocation is permitted. Allocation hook functions are prototyped as follows:
BOOL AFXAPI AllocHook( size_t nSize, BOOL bObject, LONG lRequestNumber );
Note that the AFXAPI calling convention implies that the callee must remove the parameters from the stack.