VB6 debugging- doesn't go to error handling code.

Posted by Can Ho on Stack Overflow See other posts from Stack Overflow or by Can Ho
Published on 2011-03-07T04:18:29Z Indexed on 2011/03/16 8:10 UTC
Read the original article Hit count: 177

Filed under:
|
|

Hi, I'm maintaining a vb6 project(ActiveX DLL). When debugging, the app run into the following function:

Public Function HasValue(ByVal vValue) As Boolean

    On Error GoTo Err

    If IsMissing(vValue) Then
        HasValue = False
    ElseIf IsNull(vValue) Or Len(vValue) = 0 Then
        HasValue = False
    ElseIf isEmpty(vValue) Then
        HasValue = False
    Else
        HasValue = True
    End If

Exit Function

Err:

    If IsArray(vValue) Or IsObject(vValue) Then
        HasValue = True
    Else
        HasValue = False
    End If
End Function

and it stops at the line

ElseIf IsNull(vValue) Or Len(vValue) = 0 Then

vValue is a custom object, contains some properties(obviously, not null).

Although I didn't put any break point there, the app stopped there and alerted error dialog saying that "Run-time error '438': Object doesn't support this property or method".

We had error handling code but the app didn't run to error handling code. It just stopped at the line causing the error and I had to stop the application.

Do you have any idea about that? Thank you very much.

© Stack Overflow or respective owner

Related posts about dll

Related posts about vb6