Visual Studio .NET has really ramped up event handling compared to previous versions of Visual Studio. Through the use of delegates, developers now have an easier way to encapsulate function pointers within class declarations than was possible before. You don't have to deal with static or global functions to deal with callbacks. You no longer have to deal with the intricacies of connection points in COM. The Unified Event Model allows you to easily create, fire, and handle events, regardless of whether your application uses native C++ code, COM, or managed C++ code.

This hour you learned some of the details behind delegates and how they work within a managed environment. By going under the hood to investigate how the attributes expand by looking at the injected code, you saw how the architecture is designed. This, in turn, can help tremendously in your design decisions. You also looked at how an event source is hooked to an event handler within an event receiver object. Little did you realize at the time that the method to perform this action was the same method you had investigated earlier with the delegate project. One thing is for certain: The use of attributes to handle delegates and events is a powerful toolset that you can use to your advantage when creating any future applications.


Sams Teach Yourself Visual C++. NET in 24 Hours
Sams Teach Yourself Visual C++.NET in 24 Hours
ISBN: 0672323230
EAN: 2147483647
Year: 2002
Pages: 237

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: