Adding an Event Using Attributes
Events allow an ActiveX control to communicate important information to its container. Using attributes, adding an event is a simple matter. For detailed information on adding and firing events from an ATL control, see Event Handling in Native C++ and Event Handling in COM.
In the past, implementing the standard features of an ActiveX control could be a tedious task. However, using the attributed programming model, the various wizards of Visual C++, and the Visual C++ compiler itself, implementing a basic ActiveX control now requires little effort, and makes use of code that has been tested and optimized by the Visual C++ team.