Microsoft KB Archive/253295

From BetaArchive Wiki
Knowledge Base


Article ID: 253295

Article Last Modified on 5/10/2006



APPLIES TO

  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition



This article was previously published under Q253295

SYMPTOMS

When a form containing an MSHFlexGrid (Msflxgrd.ocx) control is loaded and unloaded, a leak in the Graphics Device Interface (GDI) system resource occurs.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual Basic 6.0 Service Pack 4.

To download Visual Basic 6.0 SP4, see the following Microsoft Web site:

MORE INFORMATION

Steps to Reproduce Behavior

  1. On a Microsoft Windows NT 4.0 or Microsoft Windows 2000 computer, start a new standard EXE project with a default form (Form1).
  2. From the Project menu, add another form (Form2).
  3. From the Project menu, select Components, check Microsoft Hierarchical FlexGrid Control 6.0 (SP3) (MSHFLXGD.OCX), and click OK.
  4. Add a CommandButton (Command1) to both Form1 and Form2. Place four MSHflexgrid controls on Form2.
  5. Add the following code to Form1:

    Private Sub Command1_Click()
        Form2.Show
    End Sub
    Private Sub Form_Load()
        Command1.Caption = "Show Form2"
    End Sub
                        
  6. Add the following code to Form2:

    Private Sub Command1_Click()
        Unload Me
    End Sub
    Private Sub Form_Load()
        Command1.Caption = "Unload Me"
    End Sub
                        
  7. Press the F5 key to run the project.
  8. Start Task Manager (CTRL+ALT+DELETE), and select the Processes tab.
  9. Under the View menu, click on Select Columns, and choose GDI Objects.
  10. Click the CommandButtons on Form1 and Form2 to load and unload Form2, and note that for each iteration, there is an increase in one GDI object.



Additional query words: memory

Keywords: kbbug kbctrl kbdevstudio kbfix kbresource kbvbp600fix KB253295