T
TJoker .NET
Hi all.
I'm writing some .net compoents that are also going to be used from vb6
code. Is there a way for me to distinguish all the different types of
exceptions that the .net code my throw ? My .net component can throw a few
different types of exceptions and I need my vb6 code to take action
differently based on which exception it comes accross.
Can I set the error number somehow on my exception classes? (maybe an
attribute ?)
I'd like my vb6 code to look like:
private Sub MySub()
On Error Goto ErrHandling
dim myDotnetObj as DotNetComponent.Class1
set myDotNetObj = new DotNetcomponent.Class1
myDotNetObj.CallMethod()
Exit Sub
ErrHandling:
Select Case err.Number
Case 123: doSomething1
Case 456: doSomething2
End Select
End Sub
I'm writing some .net compoents that are also going to be used from vb6
code. Is there a way for me to distinguish all the different types of
exceptions that the .net code my throw ? My .net component can throw a few
different types of exceptions and I need my vb6 code to take action
differently based on which exception it comes accross.
Can I set the error number somehow on my exception classes? (maybe an
attribute ?)
I'd like my vb6 code to look like:
private Sub MySub()
On Error Goto ErrHandling
dim myDotnetObj as DotNetComponent.Class1
set myDotNetObj = new DotNetcomponent.Class1
myDotNetObj.CallMethod()
Exit Sub
ErrHandling:
Select Case err.Number
Case 123: doSomething1
Case 456: doSomething2
End Select
End Sub