Doh...what am I thinking!..sorry...should have tested it before blindly posting......
Anyway I did an app to try this and used;
Code:
void CMFCMemDlg::OnRefresh()
{
MEMORYSTATUS mem_stat;
::GlobalMemoryStatus(&mem_stat);
m_TotalPhys.Format("%ld KB", mem_stat.dwTotalPhys / 1024);
m_AvailPhys.Format("%ld KB", mem_stat.dwAvailPhys / 1024);
m_AvailPageFile.Format("%ld KB", mem_stat.dwAvailPageFile / 1024);
m_TotalVirtual.Format("%ld KB", mem_stat.dwTotalVirtual / 1024);
m_AvailVirtual.Format("%ld KB", mem_stat.dwAvailVirtual / 1024);
m_MemLoad.Format("%d %%",mem_stat.dwMemoryLoad);
UpdateData(FALSE);
}
Based on your code, and the memory load is in the 70s.....not 0 or 100!!.....I wonder it actually dispalying the right value for that??
Anyway, here's the code I drew up....if you wish, compile it and see if the % value in my app is different to yours...