BUG: DHTML Edit Control Leaks Memory (295432)



The information in this article applies to:

  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0 SP3
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0 SP4
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0 SP5

This article was previously published under Q295432

SYMPTOMS

When you repeatedly load and unload a form that contains a Dynamic HTML (DHTML) Edit control from Internet Explorer 5.5 Service Pack 1 (SP1), you may encounter a memory leak. This problem occurs with DHTML Edit control (Dhtmled.ocx) version 6.1.0.8852.

RESOLUTION

To work around this problem, use Hide and Show methods on the form instead of the Unload and Load methods.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new standard EXE project in Visual Basic. Form1 is created by default.
  2. Add a command button (Command1) to Form1.
  3. Add the following code to Form1:
    Private Sub Form_Load()
        Command1.Caption = "Load Form2"
    End Sub
    
    Private Sub Command1_Click()
        Form2.Show
    End Sub
    					
  4. In the Components dialog box, add DHTML Edit control for IE5 to your project.
  5. Add a new (Form2) to your project, and add a command button (Command1) to Form2.
  6. Add a DHTML Edit Control to Form2.
  7. Add the following code to Form2:
    Private Sub Form_Load()
        Command1.Caption = "Unload the form"
    End Sub
    
    Private Sub Command1_Click()
        Unload Me
        
        'WORKAROUND: Uncomment the next line to use the Hide method instead.
        'Me.Hide
    End Sub
    					
  8. Run the project. Load and unload Form2 repeatedly. In Performance Monitor or Task Manager, notice that a memory leak has occurred.

REFERENCES

For more information, see the following Microsoft Web sites: For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbBug kbCtrl kbDHTML kbpending KB295432