This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here
Retrieves the memory bytes occupied by the program.
HRESULT GetMemoryBytes( IDebugMemoryBytes2** ppMemoryBytes );
int GetMemoryBytes( out IDebugMemoryBytes2 ppMemoryBytes );
[out] Returns an IDebugMemoryBytes2 object that represents the memory bytes of the program.
If successful, returns
S_OK; otherwise, returns an error code.
The memory bytes as represented by the IDebugMemoryBytes2 object is for the program's image in memory and not any memory that was allocated when the program was executed.