BUG: Custom OCX Not Unloaded When Client Application EndsLast reviewed: September 3, 1997Article ID: Q173351 |
The information in this article applies to:
SYMPTOMSIf a variable is set to reference a UserControl or one of its constituent controls in the InitProperties and ReadProperties events of the UserControl, the reference is not released when the client application ends; therefore, the OCX remains loaded. Because the OCX does not unload, its Terminate event is not triggered when the application ends.
RESOLUTIONYou can work around this problem by using a variable that saves the Name property of the control rather than an actual reference to the control. For example, if you are using the following code in a UserControl in which the Terminate event is not triggered:
Dim o As Object Private Sub UserControl_InitProperties() Set o = Label1 End Sub Private Sub UserControl_ReadProperties(PropBag As PropertyBag) Set o = Label2 End Subreplace the code with the following:
Dim s As String Private Sub UserControl_InitProperties() s = Label1.Name End Sub Private Sub UserControl_ReadProperties(PropBag As PropertyBag) s = Label2.Name End Sub STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
Keywords : vb5all Version : WINDOWS:5.0 Platform : WINDOWS Issue type : kbbug |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |