FIX: Stack Fault May Occur If Trapping Divide By ZeroID: Q95499
|
When trapping a divide by zero or divide overflow error (error numbers 11 and 6 respectively) in a Visual Basic program, you may receive a stack fault if an MS-DOS session is also running. In this situation, the computer may also hang (stop responding) or automatically reboot.
This problem is caused by the Windows mathematics exception handling, not by Microsoft Visual Basic.
The only way to avoid this problem is to terminate all MS-DOS sessions before running a Visual Basic application that traps divide by zero or divide overflow errors.
Microsoft has confirmed this to be a bug in Microsoft Windows version 3.1. This problem has been corrected in Visual Basic version 4.0.
Sub Form_Click ()
On Error Resume Next
Top:
x% = DoEvents()
y% = 1 \ 0 'This will cause a division by zero error
GoTo top
End Sub
Additional query words: buglist2.00 buglist3.00 fixlist4.00 2.00 3.00
Keywords : kbenv EnvtRun
Version : 2.00 3.00
Platform : WINDOWS
Issue type :
Last Reviewed: June 18, 1999