Martin_SBT
July 26th, 2006, 01:04 PM
(asp.net with vb.net in VS2003)
I got a custom Class with a "Sub New" in it. That sub New contains code that make some calls to a COM dll component. In that sub New, i can catch the exception error messages using:
Try
eSession2.Connect()
Catch COMex As COMException
'Debug.WriteLine(comex.ErrorCode)
Debug.WriteLine(comex.Message)
'
sourcepage.logonerror = COMex.Message
Exit Sub
End Try
Lets say i instantiate my custom class in my webform1 by saying:
dim obj as new customClass
How can i generate in error in the sub New of my customClass that i could catch when i instantiate my class from webform1??
Does it make any sense??
I got a custom Class with a "Sub New" in it. That sub New contains code that make some calls to a COM dll component. In that sub New, i can catch the exception error messages using:
Try
eSession2.Connect()
Catch COMex As COMException
'Debug.WriteLine(comex.ErrorCode)
Debug.WriteLine(comex.Message)
'
sourcepage.logonerror = COMex.Message
Exit Sub
End Try
Lets say i instantiate my custom class in my webform1 by saying:
dim obj as new customClass
How can i generate in error in the sub New of my customClass that i could catch when i instantiate my class from webform1??
Does it make any sense??