Hi,

I have a multi-thread program, and if I want to check the size of
memory that has been allocated in the stack in one of the thread. Is
there any fucntion avaiable in VC6.0?

Thanks in advance!

Re: Is there any function that I can use to check the current stack by Gerard

Gerard
Mon Nov 28 13:24:04 CST 2005

Try this

MEMORY_BASIC_INFORMATION mbi;
LPBYTE pHere = (LPBYTE)&pHere;

::VirtualQuery(pHere, &mbi, sizeof mbi);

// mbi.AllocationBase is the numerically lowest address of the stack
// region, i.e., where it can grow down to.
return pHere - (LPBYTE)mbi.AllocationBase;


kimso.zhao@gmail.com wrote:
> Hi,
>
> I have a multi-thread program, and if I want to check the size of
> memory that has been allocated in the stack in one of the thread. Is
> there any fucntion avaiable in VC6.0?
>
> Thanks in advance!
>