Using the RTL Cross-Platform Messaging Solution

From RAD Studio
Jump to: navigation, search

Go Up to Using Messages
Go Up to Using the RTL in Multi-Device Applications


The RTL provides a cross-platform messaging solution, implemented in the System.Messaging unit.

Sending and Receiving Messages

The RTL cross-platform messaging solution is based on a message manager:

  • Components that want to receive messages of a a certain type subscribe to the target message type on the message manager.
  • Components send messages to the message manager, which relays those messages to components subscribed to the type of the received message.

For more information, see Sending and Receiving Messages Using the RTL.

RAD Studio Frameworks Support for RTL Messages

You can use the RTL cross-platform messaging solution both with FireMonkey and with the VCL.

FireMonkey Support for RTL Messages

FireMonkey provides a platform service, IFMXApplicationService, that provides cross-platform access to event notifications so that you do not need to use a different, platform-specific event system on each platform that your application targets. When IFMXApplicationService receives an event notification from the operating system, it generates a message object (TMessage or one of its descendants) to provide the event data. The message object contains read-only information about the event that occurred. The type of the message object indicates the type of event that occurred.

FireMonkey components also rely on RTL messages to communicate with each other.

FireMonkey components send messages to the default message manager. For a list of FireMonkey message types, see List of FireMonkey Message Types.

VCL Support for RTL Messages

The VCL framework does not use RTL cross-platform messaging solution; instead, it uses the Windows API messaging solution. This means that the VCL does not translate Windows messages into RTL messages for you, and VCL components communicate with each other using the Windows API as well.

You can use RTL messages in your project only if you do not need to capture the messages from Windows or VCL components. For example, you may use RTL messages to handle threads in a multi-threaded application or to write components that only send and receive messages from each other.

If you need access to messages from Windows or VCL components, you must do either of the following:

Topics

See Also