Microsoft KB Archive/257621

= FIX: Resources Lost When Loading Modal Form from ActiveX Server =

Article ID: 257621

Article Last Modified on 8/7/2007

-

APPLIES TO

 Microsoft Visual Basic 6.0 Learning Edition, when used with:  Microsoft Windows 95

 Microsoft Windows 98 Standard Edition  Microsoft Visual Basic 6.0 Professional Edition, when used with:  Microsoft Windows 95

 Microsoft Windows 98 Standard Edition</li></ul> </li> Microsoft Visual Basic 6.0 Enterprise Edition, when used with:  Microsoft Windows 95</li></ul>

 Microsoft Windows 98 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q257621

<div class="symptoms_section">

SYMPTOMS
When a client loads a modal form from an ActiveX EXE server and leaves it up for an extended period of time, the server may experience a severe resource leak under Microsoft Windows 95 and Microsoft Windows 98. This behavior happens even without any user interaction with the application. If you close the modal form to shut down the server, the resource recovers. The resource loss does not occur with a non-modal form.

<div class="cause_section">

CAUSE
The client application is in a frozen state waiting for the modal form to go away. During this time the message queue fills up and, therefore, system resources are lowered.

<div class="status_section">

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 the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed

To download the latest Visual Studio service pack, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/vstudio/Aa718353.aspx

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol> Create a new ActiveX EXE project and rename it to ModalSvr. Class1 is created by default.</li>  Paste the following code in Class1: Public Sub ShowForm Form1.Show vbModal End Sub </li> From the Project menu, add a new form, Form1.</li> Save and compile the project. ModalSvr.exe is made and registered on the computer.</li> Create a new Standard EXE project as the client. Form1 is created by default.</li> Add one TextBox and one CommandButton to Form1.</li>  Paste the following code to the code window of Form1: Dim obj As Object Private Sub Command1_Click Set obj = CreateObject("ModalSvr.Class1") obj.ShowForm Set obj = Nothing End Sub

Private Sub Form_Load Text1.Text = "" End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If Not ((KeyCode = vbKeyF4) And (Shift = vbAltMask)) Then Command1_Click End If End Sub </li> On the Start menu, choose Programs, choose Accessories, choose System Tools, and then choose Resource Meter. If Resource Meter is not available, on the Start menu, choose Control Panel, choose Add/Remove Programs, and then choose the Windows Setup tab to add it.</li> Press the F5 key to run the client. Click on the TextBox and press the F4 key to launch the server and its modal form.</li> <li>Watch the Resource Meter and note that the System and User resources gradually go down. Closing the modal form to shut down the server recovers the resources. If you use the KeyUp event or click Command1 to launch the modal form, the leak is not as severe.</li></ol>

Additional query words: sp4

Keywords: kbbug kbfix kbresource kbvs600sp4fix kbvs600sp5fix KB257621

-

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

© Microsoft Corporation. All rights reserved.