G
Guest
Hi all,
I'm using Windows CE.net 4.2 with .NET 1.1. I'm trying to use the
GlobalMemoryStatus() subroutine to determine the percentage of memory used
for the whole system instead of just my application. I've P/Invoked (at
least I think this is what P/Invoking is) using the following:
Public Declare Sub GlobalMemoryStatus Lib "coredll.dll" Alias
"GlobalMemoryStatus" (ByVal lpBuffer As MEMORYSTATUS)
I've also created a structure:
Public Structure MEMORYSTATUS
Public dwLength As Long
Public dwMemoryLoad As Long
Public dwTotalPhys As Long
Public dwAvailPhys As Long
Public dwTotalPageFile As Long
Public dwAvailPageFile As Long
Public dwTotalVirtual As Long
Public dwAvailVirtual As Long
End Structure
and finally have a variable declared in which to store the information:
Public Mem As MEMORYSTATUS
When I get to this line in my code:
GlobalMemoryStatus(Mem)
I receive a System.NotSupportedException error.
I'm hoping rebuilding the platform is not the solution becuase that would be
a last resort for us. I've found the coredll.lib on my desktop but when I
try to add that as a reference in Solution Explorer I'm told that it must be
a DLL to be referenced. So I found a DLL but when I tried to reference that
Visual Studio told me it wasn't a valid .NET reference. I've looked through
my
C:\Program Files\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows CE folder and don't see
coredll.dll anywhere.
Help?!? I have no clue what else to try to enable me to use the
GlobalMemoryStatus subroutine
I'm using Windows CE.net 4.2 with .NET 1.1. I'm trying to use the
GlobalMemoryStatus() subroutine to determine the percentage of memory used
for the whole system instead of just my application. I've P/Invoked (at
least I think this is what P/Invoking is) using the following:
Public Declare Sub GlobalMemoryStatus Lib "coredll.dll" Alias
"GlobalMemoryStatus" (ByVal lpBuffer As MEMORYSTATUS)
I've also created a structure:
Public Structure MEMORYSTATUS
Public dwLength As Long
Public dwMemoryLoad As Long
Public dwTotalPhys As Long
Public dwAvailPhys As Long
Public dwTotalPageFile As Long
Public dwAvailPageFile As Long
Public dwTotalVirtual As Long
Public dwAvailVirtual As Long
End Structure
and finally have a variable declared in which to store the information:
Public Mem As MEMORYSTATUS
When I get to this line in my code:
GlobalMemoryStatus(Mem)
I receive a System.NotSupportedException error.
I'm hoping rebuilding the platform is not the solution becuase that would be
a last resort for us. I've found the coredll.lib on my desktop but when I
try to add that as a reference in Solution Explorer I'm told that it must be
a DLL to be referenced. So I found a DLL but when I tried to reference that
Visual Studio told me it wasn't a valid .NET reference. I've looked through
my
C:\Program Files\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows CE folder and don't see
coredll.dll anywhere.
Help?!? I have no clue what else to try to enable me to use the
GlobalMemoryStatus subroutine