当调用函数发生错误时,我想自定义自己的错误框和消息。
我尝试使用try捕获异常,但不执行任何操作
Try
L = objGeoFlowDLL.GFCalc_Main(nInputs, nOutputs, sngInputs, sngOutputs)
Catch ex As Exception
MessageBox.Show(ex.Message)
' Me.Close()
Finally
End Try
答案 0 :(得分:0)
Try
L = objGeoFlowDLL.GFCalc_Main(nInputs, nOutputs, sngInputs, sngOutputs)
Catch ex As DivideByZeroException
MessageBox.Show("Custom message to be shown when something is divided by zero.")
Catch ex2 As Exception
MessageBox.Show("Custom message to be shown when any other error occurs.")
End Try