FIX: Multiple CreateObject May Cause GP Fault in VBOA300.DLLLast reviewed: October 30, 1997Article ID: Q113438 |
3.00
WINDOWS
kbole kbbuglist
The information in this article applies to: - Microsoft Visual Basic programming system for Windows, version 3.0
SYMPTOMSA general protection (GP) fault may result when working with OLE objects in Visual Basic if you repeatedly create new OLE objects.
CAUSEWhen OLE objects are created with Visual Basic and that OLE object is subsequently set to Nothing, a hidden instance of the OLE application is spawned and then orphaned. This uses up system resources and eventually either the machine will hang (stop responding to input) or a GP fault will occur in VBOA300.DLL at 0001:0D03.
WORKAROUNDWhen you create OLE objects. Be sure to close or quit the OLE object before setting the variable to Nothing. Please see the example at the end of this article.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been corrected in Visual Basic version 4.0.
MORE INFORMATION
Steps to Reproduce Problem
Example WorkaroundThe following code will not produce a GP fault:
Sub Command1_Click () Dim X As object Dim R As object Dim Iterations As Integer While True Iterations = Iterations + 1 Debug.Print Iterations Set X = CreateObject("Excel.Sheet.5") ' Enter the following two lines as one, single line: Set R = X.Parent.Sheets(1).Range(X.Parent.Sheets(1).Cells(2, 2), X.Parent.Sheets(1).Cells(52, 2)) ' The next line quits the application for an Excel object X.Application.Quit Set R = Nothing Set X = Nothing Wend End Sub |
Additional reference words: buglist3.00 GPF EXCEL 5.00 WINWORD 6.00 VBASIC
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |