Is there a way to add a global error handler to a Visual Basic 6.0 application?

VB 6.0 does not have a global handler. To catch errors at runtime, we need to add a handler to each method where we feel that an error may occur. But still, some places may be omitted. So, we get runtime errors.Adding an error handler in all application methods, the only way?

+4
source share
5 answers

There is no way to add a global error handler in VB6. However, you do not need to add an error handler to each method. You really need to add an error handler to each event handler. For instance. Each click event, load event, etc.

+6
source

As long as errors propagate upward, VB6 is not able to trace the stack, so you never know which method caused the error. Unfortunately, if you need this information, you need to add a handler for each method to register where you were.

+2
source

Also: errors propagate upward: if method X calls methods Y and Z, one error handler in method X will cover all three methods.

+1
source

Yesterday I discovered this tool:

http://www.everythingaccess.com/simplyvba-global-error-handler.htm

This is a commercial product that allows you to handle global errors in VB6 and VBA applications.

It has its own costs, but it works great. I saw other tools (free, though) that help with this crippled VB6, but no one can cover the true real global error handling, like "SimplyVB6 Global Error Handler for VB6".

With the "SimplyVB6 Global Error Handler for VB6", there is no need to change any line of existing code and no need to specify lines of code (through a plug-in or something else). Just enable global error handling (one line of code in the main module) and everything will be installed.

"SimplyVB6 Global Error Handler for VB6":

  • can display a call stack with real names of modules and functions, and also display a line of source code.
  • Works only with compiled VB6 P-Code programs.
  • can work through early or late binding (not DLL Hell).

I am in no way affiliated with www.everythingaccess.com, just happy that I found it yesterday afternoon, examined this issue again, as one of my clients had errors in our VB6 application. I was able to test the tool yesterday afternoon, exchanged emails with support from www.everythingaccess.com and receive an evaluation product for mail. Their web side does not yet allow you to download the evaluation version of the VB6 product, you need to send them an e-mail, but they respond in less than an hour.

0
source

when you re-enable the error - this is pretty close, but it has been a while. you can see any reservations

-3
source

Source: https://habr.com/ru/post/1276702/


All Articles