NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ThreadExceptionEventArgs Constructor

Initializes a new instance of the ThreadExceptionEventArgs class.

[Visual Basic]
Public Sub New( _
   ByVal t As Exception _
)
[C#]
public ThreadExceptionEventArgs(
   Exception t
);
[C++]
public: ThreadExceptionEventArgs(
   Exception* t
);
[JScript]
public function ThreadExceptionEventArgs(
   t : Exception
);

Parameters

t
The Exception that occurred.

Example [Visual Basic]

The following example creates a new instance of ThreadExceptionEventArgs and initializes it with an TBD. The Exception is then retrieved from the exception field and the error message displayed. No form is associated with this code.

[Visual Basic]

'The main entry point for the application
Shared Sub Main()
    ' Declare a ThreadExceptionEventArgs.
    Dim myEventArgs As ThreadExceptionEventArgs
    ' Declare Exception objects
    Dim myException As Exception
    Dim myException1 As Exception
    ' Create an exception object
    Set myException = New Exception("This is an exception test")
    ' Create a ThreadExceptionEventArgs containing the exception object
    Set myEventArgs = New ThreadExceptionEventArgs(myException)
    ' Extract the exception from the ThreadExceptionEventArgs.
    Set myException1 = myEventArgs.exception
    ' Display the exception returned from the ThreadExceptionEventArgs object.
    MessageBox.Show "The exception returned is: " & myException1.Message, "ThreadExceptionEventArgs"
End Sub

See Also

ThreadExceptionEventArgs Class | ThreadExceptionEventArgs Members | System.Threading Namespace | Thread | ThreadStart