Results 1 to 1 of 1

Thread: Advanced Error Handler

Hybrid View

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Advanced Error Handler

    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:
    1. Private Sub MyWoofWoofs()
    2.    'Code here
    3. End Sub
    But instead, MsgBox the error in:
    VB Code:
    1. Private Sub cmdLoad_Click()
    2.    MyWoofWoofs
    3. 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
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width