AfxDumpStack

void AFXAPI AfxDumpStack(DWORD dwTarget = AFX_STACK_DUMP_TARGET_DEFAULT);

Parameters

dwTarget

Indicates the target of the dump output. Possible values, which can be combined using the bitwise-OR (|) operator, are as follows:

Remarks

This global function can be used to generate an image of the current stack. The example below reflects a single line of the output generated from calling AfxDumpStack from a button handler in an MFC dialog applicaton:

=== begin AfxDumpStack output ===
…
BFF928E0: WINDOWS\SYSTEM\KERNEL32.DLL! UTUnRegister + 2492 bytes

=== end AfxDumpStack() output ===

The following table describes the above line of output:

Output Description
BFF928E0: The return address of the last function call.
WINDOWS\SYSTEM\KERNEL32.DLL! The full path name of the module that contains the function call.
UTUnRegister The function prototype called.
+ 2492 bytes The offset in bytes from the address of the function prototype (in this case, UTUnRegister) to the return address (in this case, BFF928E0).

AfxDumpStack is available in debug and nondebug versions of the MFC libraries; however, the function is always linked statically, even when your executable file uses MFC in a shared DLL. In shared-library implementations, the function is found in the MFCS42.LIB library (and its variants).

To use this function successfully:

See Also   afxDump