Visual Basic Concepts
The topics "Asynchronous Notifications Using Call-Back Methods" and "Asynchronous Notifications Using Events" demonstrate that call-backs are more work to implement than events. However, you should not base your decision about which to use on the amount of work involved. Call-backs and events represent different approaches to communication, and you should select the approach that best fits your needs.
You can characterize the difference between events and call-backs as follows: An event is like an anonymous broadcast, while a call-back is like a handshake.
The corollary of this is that a component that raises events knows nothing about its clients, while a component that makes call-backs knows a great deal.
Here’s what these things mean to you as a developer:
By contrast, a component that's making call-backs must have a reference to every object it's going to call. It has to know exactly how many of them there are.
By contrast, a component making call-backs can control the order in which it calls clients back. It might give some clients higher priority, for example.
By contrast, a component making call-backs gets control back after each call it makes to a client.
By contrast, a component making call-backs can examine changes to ByRef arguments after every call to a client, and can pass the next client fresh values for those arguments.
By contrast, a component making call-backs will receive errors that occur in the call-back method, and must be prepared to handle them.
Note An additional difference between events and call-back methods is that events cannot have optional arguments, named arguments, or ParamArray arguments.
A component can provide some notifications using call-backs, and some using events. The nature of the notification determines which mechanism should be used. You should use an event to provide a notification when all of the following statements are true:
If any one of the statements above is false, then you should do the extra work necessary to provide the notification using call-back methods.
You may also want to do the extra work to use call-backs when performance is critical. You can get vtable binding with call-back methods by using the Implements statement to add the call-back interface to the client's call-back object. Events are not vtable bound. (This will be much more noticeable with an in-process component that provides events or call-backs.)