Learn C++ Event Handling In 5 Minutes

In this short tutorial, C++ Product Manager, David Millington, explains what event handlers are and how to use them in your C++ application development. 


  • The event is that something happens. 
  • Event handler – a method that’s called when something happens or is attached to an event.
    • Technical details: an object-method pointer, referring to both the method and object instance on which to call the method. And it can have any signature.

Defining Event Handlers

In an event receiver class, you define event handlers, which are methods with signatures for instance: return types, calling conventions, and arguments that match the event that they will handle.

Firing Events

To fire an event, simply call the method declared as an event in the event source class. If handlers have been hooked to the event, the handlers will be called.

Be sure to check out other tutorials on C++ Builder here: