RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomVariantType.OlePromotion Method

Indicates the type to which a Variant value must be cast to make it Automation-compatible.

Pascal
function OlePromotion(const V: TVarData; out RequiredVarType: TVarType): Boolean; virtual;
C++
virtual __fastcall Boolean OlePromotion(const TVarData V, TVarType RequiredVarType);

Override OlePromotion to indicate when a Variant of this custom Variant type must be cast to another type before it can be auto-marshaled using an Automation interface. 

V is the TVarData record for the custom Variant that the application wants to marshal. 

RequiredVarType returns the type to which V must be cast before it is Automation-compatible. 

OlePromotion returns true if V can be cast to an Automation-compatible type, false if there is no type to which V can be cast. 

As implemented in TCustomVariantType, OlePromotion sets RequiredVarType to varOleStr and returns true if V does not already represent a Unicode string. 

 

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