Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As we all know, we can catch a runtime error in VB6.0 using this statement —— "On Error GoTo ...". However, if I programm in this manner, I have to write a lot of similiar code in each Sub Or Functon. I consider it time-consuming and really boring! So,here comes a question, "Can We Do It All In One Sub Or Function Or Even In Another Process(like "BugReport.exe")". I very much prefer starting a new process to record detailed runtime parameters of my target process and save them to a log if necessary, but I am a beginner of Programming With VB. So, can anybody give me some pratical suggestions? Much appreciated!
Posted

1 solution

To blindly answer your question I can direct you to this old article[^]

You could have the error handling in a completely separate activeX dll if you really wanted to ... see how to create an activeX dll[^], but you're probably better off just having the centralised error function in a separate .bas module to be included in your projects.

Having said all that ... you do realise that VB6 is no longer supported?

Unless there are constraints (such as the corporation you work for already has a code base in VB6 and you have to continue to maintain it), then I would advise you to "upgrade" to a .NET language. The Express versions are free (unlike VB6) - http://www.visualstudio.com/downloads/download-visual-studio-vs[^], will have greater longevity, and have better error-handling capabilities
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900