Language: Callbacks

This solution demonstrates how to perform callbacks using both interfaces and delegates. Press Ctrl+F5 to run the program and ignore the breakpoints.

Featured Highlights

This application allows the user to make a series of calls that include a call back into the client during execution.

The first button makes this call using an interface, and requires a registration and unregistration step. The second button performs the same action using a delegate, and also requires registration and unregistration for the call. The third button causes the same behavior as the second button, except that the callback is performed asynchronously. The fourth button represents an asynchronous call using an AsyncCallback delegate to call back into the client. The call itself is asynchronous, and the worker thread that services the call also performs the callback.

Requirements

Requires the Trial or Release version of Visual Studio .NET Professional (or greater).

Running the Sample

To run the application, press F5. You should run the application in debug mode, placing breakpoints as necessary, to examine the code consturcts. 

Last Update: 7 July 2002