The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
ErrorEventArgs::GetException Method ()
.NET Framework (current version)
Gets the Exception that represents the error that occurred.
Assembly: System (in System.dll)
The following example creates a new instance of ErrorEventArgs and initializes it with an Exception. Then the example calls GetException to retrieve the Exception and display the error message. There is no form associated with this code.
int main() { //Creates an exception with an error message. Exception^ myException = gcnew Exception( "This is an exception test" ); //Creates an ErrorEventArgs with the exception. ErrorEventArgs^ myErrorEventArgs = gcnew ErrorEventArgs( myException ); //Extracts the exception from the ErrorEventArgs and display it. Exception^ myReturnedException = myErrorEventArgs->GetException(); MessageBox::Show( String::Concat( "The returned exception is: ", myReturnedException->Message ) ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: