The information in this article applies to:
SYMPTOMS
A UserControl is added to a Visual Basic project. When you try to exit the
IDE, Visual Basic causes an Invalid Page Fault (IPF) and terminates. This
is preceded by the error message:
CAUSEThe problem is that the UserControl has two module level variables, one that holds onto a reference to the UserControl itself (Set m_oMe = Me) and another that holds a reference to control's parent (Set m_oParent = Extender.Parent). This causes a circular reference count on the control and the container. When you try to exit the IDE, Visual Basic destroys the design-time form container and attempts to release the UserControl instance. Because the control has a reference to itself and the form, Visual Basic cannot properly destroy the objects; consequently an Invalid Page Fault occurs. RESOLUTIONAvoid setting module level variables that reference both a control and its container. Setting the variables to Nothing in the UserControl_Terminate event will not avoid the error because the Terminate event will never fire if the control has a circular reference. 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 INFORMATIONSteps to Reproduce Behavior
REFERENCES
For additional information, please see the following articles in the
Microsoft Knowledge Base:
Q189156 : BUG: Crash When Closing Application That Uses ActiveX DLL Additional query words: kbDSupport kbDSD kbVBp kbVBp600bug kbVBp500bug kbCtrlCreate kbIDE
Keywords : kbGrpVB |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |