Microsoft KB Archive/95461

= BUG: Memory Loss w/ Repeated Display of MsgBox or Modal Form =

PSS ID Number: 95461

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q95461



SYMPTOMS
Repeatedly displaying a message box or modal form in a Visual Basic for MS-DOS program may incorrectly cause permanent far-heap memory loss. This memory is not recovered until you terminate the VBDOS.EXE environment or end your compiled program (if running a compiled .EXE). The memory loss only occurs if the code is part of a Sub or Function procedure and not part of the module-level code in a startup module.



WORKAROUND
To work around the problem, do not show forms modally.



STATUS
Microsoft has confirmed this to be a bug in both the Standard and Professional Editions of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The amount of memory lost with each form shown depends on the number of controls on the form. More memory is lost with more controls.

Steps to Reproduce Problem
 Start VBDOS.EXE. Choose New Form... from the File menu (FORM1.FRM). Save the file and exit from FD.EXE.  Add the following code to Form1's Form_Click event procedure: Sub Form_Click For i = 1 TO 10 MsgBox STR$(FRE(-1)) Next End Sub  Press the F5 key to run the example. Then use the mouse to click Form1. A message box appears showing the amount of free far-heap space. After about 5 repetitions, the amount of free space decreases by about 400 bytes each time.</ol>

Additional query words: VBmsdos buglist1.00 1.00

Keywords: kbbug KB95461

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.