Microsoft KB Archive/134888

= BUG: GDI Memory Not Released in Windows 95 After Memory Error =

Article ID: 134888

Article Last Modified on 5/7/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q134888



SYMPTOMS
Running a program that uses up all GDI memory in Windows 95 causes this error:

Not enough memory to complete this operation

After the error message is closed, GDI memory is still not released. Running the program a second time causes Visual FoxPro to quit.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Problem
  Run the following program. You will get the error "Not enough memory to complete this operation." All GDI has been used and will not be released. *Attempt to create and release 2500 windows

PRIVATE ALL EXCEPT g_*

cOldPrint = SET('PRINT',1) SET PRINT OFF SET PRINT TO

nMaxRows = 25 nMaxCols = 100

nBeforeHandles = SYS(1011)

WAIT WINDOW 'Patience ... may look dead, check system clock' NOWAIT

FOR i = -1 TO nMaxRows FOR j = -1 to nMaxCols cWindowName = 'Win'+ALLTRIM(STR(ABS(i)))+'_'+ALLTRIM(STR(ABS(j))) DEFINE WINDOW (cWindowName); FROM i,j TO i+10,j+10 ; TITLE (cWindowName) ACTIVATE WINDOW (cWindowName) ENDFOR ENDFOR FOR i = -1 TO nMaxRows FOR j = -1 to nMaxCols RELEASE WINDOW ENDFOR ENDFOR

SET PRINT TO &cOldPrint SET PRINT ON

nAfterHandles = SYS(1011) nDiff = VAL(nAfterHandles) - VAL(nBeforeHandles) ?IIF(nDiff > 50,'FAIL','PASS')

* Clean up and exit

WAIT CLEAR

RELEASE ALL EXCEPT g_* RETURN  Run the program again and Visual FoxPro will quit. Then GDI is released.

Additional query words: hang stop dump crash kbvfp300 kbvfp500 kbvfp600

Keywords: kbbug kbenv KB134888

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.