Application definded or object define error when calling Err.Raise in vb6-Closed

时间:2015-06-30 19:18:48

标签: error-handling vb6

In my vb application when an error occur and I want to raise it using err.raise the error message is totally different from what I put in it description and it said failed in the same line of the Err.Raise function, after searching the error that I did mentioned above no useful information could anyone check where I'm doing wrong

Public Sub ErrorHandler()
        '<EhHeader>
        On Error GoTo PROC_ERR
        '</EhHeader>

        Dim sSysMsg As String
100     sProcedureName = "[" & CONST_CLASS_NAME & "." & sProcedureName & "] "

102     If RaiseSystemError Then
104         Err.Raise CONST_CLASS_ERROR, , sErrorMessage & vbCrLf & sProcedureName
        Else
106         If Err <> 0 Then
108             sSysMsg = "[" & Error$(Err) & "] " & vbCrLf
            End If
110         sErrorMessage = sErrorMessage & vbCrLf & sSysMsg & sProcedureName
        End If

112     sProcedureName = ""
114     bMethodFailed = True
116     Err = 0

        '<EhFooter>
        PROC_EXIT:
        Exit Sub
        PROC_ERR:
        If modErr.iHandleError(Err, Erl(), "cWtSvr.ErrorHandler") = vbRetry Then Resume
        Resume Next
        '</EhFooter>
End Sub

the error point to line 104

"Error N0" 4444, Application-defined or object error occured in function name of exe.name of the class.ErrorHandler at line 104"

Note that Error N0:4444 is my own custom error while the rest of the error is not what I need to output so not sure what is going one

Many thanks

1 个答案:

答案 0 :(得分:0)

我能够找出原因是什么原因我无法进入Err.Raise的代码但是在做了一些阅读后我能够改变VB6 IDE配置如何进入提升错误,我发现它在类代码中的问题。 非常感谢您试图帮助