RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TPublishableVariantType.GetProperty Method

Returns the value of a published property on the object that GetInstance returns, so that it is available in custom Variants.

Pascal
function GetProperty(var Dest: TVarData; const V: TVarData; const Name: string): Boolean; override;
C++
virtual __fastcall Boolean GetProperty(TVarData Dest, const TVarData V, const AnsiString Name);

GetProperty enables an application to read the properties of instances of the publishable Variant type. It implements all the properties that are published by the object that GetInstance returns. 

When the application contains a line such as

PropValue := MyVariant.SpecialProperty;

(Delphi) or calls the Exec method of the Variant (C++), a call is automatically generated to GetProperty. If SpecialProperty is a published property on the object that implements the Variant's data, GetProperty fills in the Dest parameter with the property value. 

Dest is a TVarData record (Delphi) or structure (C++) that receives the property value. 

V is the TVarData record or structure from the Variant instance whose property is being read. 

Name is the name of the property. 

GetProperty returns true if it returns a property value, and raises an exception if it does not implement the specified property. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!