Click to See Complete Forum and Search --> : error handling


Cakkie
February 25th, 2000, 04:31 AM
I have a form wich uses a wisock control. This winsock control is used by several other forms in about 30 subs and functions. Is there a way to apply errorhandler that work for the whole project/form/module. Now I have to place an errorhandler in almost every sub, wich makes my code bigger, and harder to read. What I want is to put my errorhandler somewhere(in the general declaration of a form???) so that it applies to all the subs in the form. Also, if this is possible, where do I have to write my errorhandler, because it is not allowed to place commands in the general declaration section. Any help would be great.

Tom Cannaerts
slisse@planetinternet.be

The best way to escape a problem, is to solve it.

Lothar Haensler
February 25th, 2000, 06:03 AM
IMHO if you want to get the exact location where the error occurred, you need to place an error handler in every sub.
There are tools out there like Numega's DevPartner for VB that allow you to add error handling code automatically to each sub. Numega's Smartcheck even allows you to trap runtime errors w/o adding anything to your vb code.