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

ID: Q95461


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


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

  1. Start VBDOS.EXE.


  2. Choose New Form... from the File menu (FORM1.FRM).


  3. Save the file and exit from FD.EXE.


  4. 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 


  5. 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.


Additional query words: VBmsdos buglist1.00 1.00

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.