A delegate is a pointer to a function in managed C++. Its just like a callback funciton pointer in traditional C++, but more powerful as it deals with the complexity issues and if you want allows you to assign several functions to be called in a single delegate.

Avoiding Using Delegates

You can pass objects to other classes / objects which they can then store and call functions of that object. For instance if you want a function to be called by lots of different classes, say to store log events, then simply create it a a class, declare it in the ap’s main class and pass a handle to it to the constructors of classes / objects you want to be able to all it. It works and is much easier than delegates!

USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.