![]() Void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ ) Programs the button to throw an exception when clicked. Inserts the code to create a form with a button. Ref class ErrorHandler: public System::Windows::Forms::Form This example assumes that you have defined two Button controls, button1 and button2, on your Form class. Since UnhandledException cannot prevent an application from terminating, the example simply logs the error in the application event log before termination. It uses the ThreadException event to handle UI thread exceptions, and the UnhandledException event to handle non-UI thread exceptions. It sets SetUnhandledExceptionMode so that all exceptions are handled by the application, regardless of the settings in the application's user configuration file. The following code example sets event handlers for exceptions that occur on Windows Forms threads and exceptions that occur on other threads. Instructs the application how to respond to unhandled exceptions, optionally applying thread-specific behavior. ![]() SetUnhandledExceptionMode(UnhandledExceptionMode, Boolean) Instructs the application how to respond to unhandled exceptions. Overloads SetUnhandledExceptionMode(UnhandledExceptionMode) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |