--- In [email protected], "Sheri" <sheri...@...> wrote:
> Didn't you read the discussion around that post?
> 
> <http://tech.groups.yahoo.com/group/power-pro/message/33075>

The thread seemed too big.  But thanks for the link to Bruce's post.  I still 
don't get it.  GlobalMemoryStatusEx() (where available) works just fine.  Why 
can't PowerPro use it?  Here's a test result on a machine with 3GB (and a 
little code below).

g:\projects\gmstest\release> gmstest.exe
3069 MB
2521 MB

HMODULE hKernel32 = GetModuleHandle(L"KERNEL32.DLL");
GMSExTYPE GMSEx = (GMSExTYPE) GetProcAddress(hKernel32, "GlobalMemoryStatusEx");
if ( GMSEx != NULL )
{
        MEMORYSTATUSEX ms = {sizeof(MEMORYSTATUSEX), 0};
        GlobalMemoryStatusEx(&ms);
        wprintf(L"%I64u MB\n", ms.ullTotalPhys / (1<<20));
        wprintf(L"%I64u MB\n", ms.ullAvailPhys / (1<<20));
}
else
{
        wprintf(L"Do it the old way.\n");
}



Reply via email to