Skip to Content
Visual Basic 2015 Unleashed
book

Visual Basic 2015 Unleashed

by Alessandro Del Sole
July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Sams
Content preview from Visual Basic 2015 Unleashed

Understanding Delegates

Delegates are type-safe function pointers. The main difference between classic function pointers (such as C++ pointers) and delegates is that function pointers can point anywhere, which can be dangerous. Delegates, on the other hand, can point only to those methods that respect delegates’ signatures. Delegates hold a reference to a procedure (its address) and enable applications to invoke different methods at runtime, but such methods must adhere to the delegate signature. Delegates also enable you to invoke a method from another object. This is important according to the main purpose of delegates, which is offering an infrastructure for handling events.

Where are Delegates Used?

Delegates are used in event-handling ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Visual Basic 2015

Beginning Visual Basic 2015

Bryan Newsome

Publisher Resources

ISBN: 9780134196664Purchase book