System.Messaging.TObjectMessage

From RAD Studio API Documentation
Jump to: navigation, search

System.Messaging.TMessageSystem.Messaging.TMessageBaseSystem.TObjectTObjectMessage

Delphi

TObjectMessage<T: class> = class(TMessage<T>)

C++

template<typename T> class PASCALIMPLEMENTATION TObjectMessage__1 : public TMessage__1<T>

Properties

Type Visibility Source Unit Parent
class public
System.Messaging.pas
System.Messaging.hpp
System.Messaging System.Messaging

Description

Base class for messages containing objects.

The contents of a TMessage can be of any type, including classes. However, when you create a TMessage with an object as value, TMessage does not take ownership of the object; you must delete the object yourself, and ensure that the message has been deleted first.

TObjectMessage provides an additional property to solve this issue. When you create a TObjectMessage, you can specify whether or not the message should take ownership of the object that it contains. If you specify that the message must own its contents, the contents of the message are destroyed when you destroy the message.

See Also