Catch System.InvalidCastException in external dll

392 views Asked by At

I'm currently facing an issue with my .net project & geckoFX.

Sometimes the element "GeckoWebBrower" (i use vb.net & graphical geckofx so this element is generate by the .dll Geckofx-Winforms.dll) give me an error "System.InvalidCastException" wich happen in it's dll "Geckofx-Winforms.dll".

I know how to catch "System.InvalidCastException" error locally (with try/catch) but i don't know how can i catch it in Geckofx-Winforms.dll

I've already reported the issue to geckofx official page but i dont know if they will do something about it and when.

I already have that code :

Private Sub InvalidCastHandler(ByVal sender As Object, _
   ByVal e As System.InvalidCastException)

    MsgBox("Execption catched")

End Sub

But i need to make it catch the errors of the dll with something like that :

AddHandler XXX, AddressOf InvalidCastHandler

The issue is that i don't know what to put for XXX.

0

There are 0 answers