Microsoft KB Archive/216587

= BUG: Previewing a report causes memory leak =

Article ID: 216587

Article Last Modified on 2/11/2005

-

APPLIES TO


 * 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 Q216587



SYMPTOMS
Issuing a REPORT FORM PREVIEW with the Status Bar set ON causes Visual FoxPro to leak one memory handle each time you close the Preview window.



RESOLUTION
Issue a SET STATUS BAR OFF before previewing the report.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. The Visual Studio 6.0 Service Pack 3 readme erroneously lists this bug as being fixed. Service Pack 3 did not fix this bug.



Steps to Reproduce Behavior
 Create a report, called mytest, containing a label in the Detail line saying "Test." (This is not a field from a table.)  Open the Employee table and place the following code in a program and run it:

SET STATUS BAR ON FOR i=1 to 10 ? SYS(1011) REPORT FORM mytest.frx PREVIEW NEXT  Run the program. When the Preview window appears, close it.

As the code runs, the notice that the number of memory handles increases by one after the first few iterations of the For.. Next loop. The problem occurs regardless of whether you close the window using the Close button on the toolbar or the Close box of the Preview form window.

The SYS(1011) function is used to determine how many memory handles are being used up by a process within FoxPro. This is an undocumented SYS function.

Additional query words: KBDSE

Keywords: kbbug kbreportwriter kbpending KB216587

-

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

© Microsoft Corporation. All rights reserved.