Luke
2008-06-18 18:38:42 UTC
Hi,
Below is shown a simplified version of a construct I have been used for
years without any problem, but now it produce an error 7(Out of memory).
What's new lately is that I have upgraded my memory from 1 to 2GB, and
upgraded Windows XP from SP2 to SP3.
Have anyone experienced memory problem with WinXP SP3?
I tried making the array global, but that didn't make any difference.
--
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#COMPILER PBCC 4.04
#COMPILE EXE
#DIM ALL
$INCLUDE "Win32API.inc"
'----------------------------------------------------------------------------------
FUNCTION PBMAIN () AS LONG
LOCAL Elements AS DWORD,ms AS MEMORYSTATUS
TRY
ms.dwLength = SIZEOF(MEMORYSTATUS)
GlobalMemoryStatus ms
Elements = ms.dwAvailPhys/%MAX_PATH
DIM myArray(1 TO Elements) AS LOCAL ASCIIZ * %MAX_PATH
CATCH
? "Error: " + FORMAT$(ERR)
END TRY
? "Availablememory: " + FORMAT$(ms.dwAvailPhys,"#,") + " bytes"
? "Elements: " + FORMAT$(Elements,"#,")
? "Press a key..."
WAITKEY$
END FUNCTION
Below is shown a simplified version of a construct I have been used for
years without any problem, but now it produce an error 7(Out of memory).
What's new lately is that I have upgraded my memory from 1 to 2GB, and
upgraded Windows XP from SP2 to SP3.
Have anyone experienced memory problem with WinXP SP3?
I tried making the array global, but that didn't make any difference.
--
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#COMPILER PBCC 4.04
#COMPILE EXE
#DIM ALL
$INCLUDE "Win32API.inc"
'----------------------------------------------------------------------------------
FUNCTION PBMAIN () AS LONG
LOCAL Elements AS DWORD,ms AS MEMORYSTATUS
TRY
ms.dwLength = SIZEOF(MEMORYSTATUS)
GlobalMemoryStatus ms
Elements = ms.dwAvailPhys/%MAX_PATH
DIM myArray(1 TO Elements) AS LOCAL ASCIIZ * %MAX_PATH
CATCH
? "Error: " + FORMAT$(ERR)
END TRY
? "Availablememory: " + FORMAT$(ms.dwAvailPhys,"#,") + " bytes"
? "Elements: " + FORMAT$(Elements,"#,")
? "Press a key..."
WAITKEY$
END FUNCTION