Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 131,614 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,106 people online right now. Registration is fast and FREE... Join Now!




Error handling for user-created events

 
Reply to this topicStart new topic

Error handling for user-created events

Tekito
post 20 Aug, 2008 - 11:00 AM
Post #1


New D.I.C Head

*
Joined: 20 Aug, 2008
Posts: 1

I have created some class modules with events and am trying to implement error handling. One thing that so far seems impossible is the ability to pass errors in event routines up the procedure stack. This is because (I think) that Visual Basic considers normal events (like clicking a form) to always be at the very top of the stack, so it does not implement passing errors up to a higher procedure. This does not make sense to me at all. For user-created events, we could be using them for all sorts of things, and they can be inside any subroutine, so I do not see why we can't pass errors for these events up the stack like normal. Is there a workaround for this, or am I missing something? Right now it is quite a pain...

(So far my best option is to go back and add a ByRef variable for the err number for every event I created, then in case of error trap it and pass this error number back to the calling procedure. But it is getting messy and hopefully it can be avoided.)
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/20/08 04:32AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month