Что нового?

Welcome to DUMPz.ws - старейший компьютерный форум (c) 2004-2021

Присоединяйтесь к нашему сообществу сейчас, чтобы получить доступ ко всем функциям форума. После регистрации Вы сможете создавать темы, публиковать ответы, общаться в чате с единомышленниками.
Blue
Red
Green
Orange
Voilet
Slate
Dark

RAD Studio Learn C++ Event Handling In 5 Minutes

FireWind

Moderator
Регистрация
2 Дек 2005
Сообщения
1,727
Реакции
1,032
Credits
998
Native language | Родной язык
Русский
Learn C++ Event Handling In 5 Minutes
November 18, 2020 By Muminjon

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

Overview

  • 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: