|
-
Sep 28th, 2008, 02:24 AM
#1
Thread Starter
Lively Member
handling unhandled exceptions
i found this in the help file:
To log an unhandled exception
Have a project selected in Solution Explorer. On the Project menu, choose Properties.
Click the Application tab.
Click the View Application Events button to open the Code Editor.
This opens the ApplicationEvents.vb file.
Have the ApplicationEvents.vb file open in the Code Editor. On the General menu, choose MyApplication Events.
On the Declarations menu, choose UnhandledException.
The application raises the UnhandledException event before the main application runs.
Add the My.Application.Log.WriteException method to the UnhandledException event handler.
and then i add this:
Code:
My.Application.Log.WriteException(e.Exception, _
TraceEventType.Critical, _
"Application shut down at " & _
My.Computer.Clock.GmtTime.ToString)
heres a stupid question: wheres the log kept at? how do i read it?
also, i saw that theres a setting in the unhandled exception event that can be set so that the app isnt terminated when the event is raised. how do i change this?
__________________
I am using Microsoft Visual Basic 2008 Express Edition. I use Access for my data base
-
Sep 28th, 2008, 03:26 AM
#2
Re: handling unhandled exceptions
 Originally Posted by dreamdelerium
heres a stupid question: wheres the log kept at? how do i read it?
If you read the documentation for the My.Application.Log.WriteException method it provides links to topics that answer those questions.
also, i saw that theres a setting in the unhandled exception event that can be set so that the app isnt terminated when the event is raised. how do i change this?
It's a property of the UnhandledExceptionEventArgs object that is passed to the event handler via the 'e' parameter. How do you usually set a property? Same applies here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|