OK. Many developers get frustrated when a user gets an error, but there is hardly any clue as to where it was generated.
The following project allows a complete history of every sub/function that the code ran through before the error was generated.
The code also allows the user to email the error to a helpdesk, although the exact code for this has not been implemented as it depends on what email system you use.
Also, the code saves all errors to a log file, in this case this is saved to the location of the main demo project as a txt file called log.txt
This demo contains 3 projects:
- Error Demo Project - just a simple EXE that forces errors
- A demo DLL Project - just a simple DLL project that forces errors
- Error Handler DLL - this deals with the handling and displaying of errors
Just unzip the attachment to this post and load the GROUP project into VB and run.
One of the main rules with error handling is do not MsgBox an error unless it's in the MAIN sub...ie:
Don't MsgBox the error in:
VB Code:
Private Sub MyWoofWoofs()
'Code here
End Sub
But instead, MsgBox the error in:
VB Code:
Private Sub cmdLoad_Click()
MyWoofWoofs
End Sub
Does that mae sense?
If you have any questions then please post replies in the following thread, which is located in General VB Questions:
http://www.vbforums.com/showthread.p...hreadid=271179
Woka