Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PROCESS_MEMORY_COUNTERS undeclared identifier.

150 views
Skip to first unread message

Cush

unread,
May 5, 2009, 4:39:01 PM5/5/09
to
InMy evc++ application I have included the following:

#include <psapi.h>
and it builds fine.

But When I use:
PROCESS_MEMORY_COUNTERS info = { sizeof( info ) };

I get the error:

error C2065: PROCESS_MEMORY_COUNTERS undeclared identifier.

I have looked in the <psapi.h> file and it does not include a definition of
PROCESS_MEMORY_COUNTERS.

Whats wrong??

Thanks

Michael Salamone

unread,
May 5, 2009, 4:53:08 PM5/5/09
to
Easy - it's not supported. There are many "big Windows" APIs not available
in Windows CE. Too keep Windows CE smaller or, because the platform is
different. In this case, for example, PROCESS_MEMORY_COUNTERS has page file
info - but Windows CE doesn't have page file. Also doesn't have quotas.

My guess is you want process memory info? If so, see if GlobalMemoryStatus
does the trick for you.

--

Michael Salamone
Entrek Software, Inc.
www.entrek.com


"Cush" <Cu...@discussions.microsoft.com> wrote in message
news:53AECBA3-C219-42F5...@microsoft.com...

Cush

unread,
May 5, 2009, 5:15:01 PM5/5/09
to
Ok Thanks,

Do you have any sample code on how to use GlobalMemoryStatus? Thanks


Michael Salamone

unread,
May 5, 2009, 6:00:49 PM5/5/09
to
Couldn't be easier. Read the help for it:
http://msdn.microsoft.com/en-us/library/aa908760.aspx

MEMORYSTATUS ms;
ms.dwLength = sizeof(ms);
GlobalMemoryStatus(&ms);

// Process-specific info (for calling process)
ms.dwTotalVirtual;
ms.dwAvailVirtual;

// Process virtual memory usage (reserved + commit)
ms.dwTotalVirtual - dwAvailVirtual;

// System info
ms.dwMemoryLoad;
ms.dwTotalPhys;
ms.dwAvailPhys;

// System usage
ms.dwTotalPhys - ms.dwAvailPhys;

// Unused/unsupported
ms.dwTotalPageFile;
ms.dwAvailPageFile;

--

Michael Salamone
Entrek Software, Inc.
www.entrek.com


"Cush" <Cu...@discussions.microsoft.com> wrote in message

news:39EF3C8F-876B-411D...@microsoft.com...

0 new messages