FIX: OLE Control Updated Event Fired in Endless Loop (149034)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q149034 SYMPTOMS
Interrupting normal execution in the Updated event of an OLE control can
cause the Updated event to be fired repeatedly, in an endless loop.
Displaying a modal form such as a dialog box causes this problem, as well
as stepping through the code in debug mode. Execution does not happen in a
normal fashion in both of these cases.
RESOLUTION
Although the code cannot be run in debug mode it does run correctly as a
compiled executable provided no modal forms are shown in the Updated event.
To show a modal form in response to an Updated event, you can enable a
timer control in the Updated event and then have the Timer's Timer event
show the form. For example:
Private Sub OLE1_Updated(Code As Integer)
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False
MyForm.Show vbModal
End Sub
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
6.0.
Modification Type: | Major | Last Reviewed: | 6/28/2004 |
---|
Keywords: | kbbug kbfix KB149034 |
---|
|