System.Messaging.TObjectMessage.Create
Delphi
constructor Create(const AValue: T; AOwnsObject: Boolean = True);
C++
__fastcall TObjectMessage__1(const T AValue, bool AOwnsObject);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
constructor | public | System.Messaging.pas System.Messaging.hpp |
System.Messaging | TObjectMessage |
Description
Creates a message with the specified object as value, and the specified ownership over the object.
The specified object, AValue
, is stored in the protected FValue property of the created message.
AOwnsObject
determines whether TObjectMessage must take ownership of the object in FValue (True
) or not (False
):
- If
AOwnsObject
isTrue
, the object in FValue is destroyed automatically when you destroy the message. - If
AOwnsObject
isFalse
, TObjectMessage behaves as TMessage; you must destroy the object in FValue manually.