System.Variants.TCustomVariantType.CastToOle

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure CastToOle(var Dest: TVarData; const Source: TVarData); virtual;

C++

virtual void __fastcall CastToOle(TVarData &Dest, const TVarData &Source);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Variants.pas
System.Variants.hpp
System.Variants TCustomVariantType

Description

Converts data in the format of this custom Variant type to a format that can be used by COM Variants.

Override CastToOle to change the way this custom type is converted for use in COM interface calls. CastToOle converts this custom Variant type to the closest Automation-compatible Variant type.

Dest is a TVarData record that returns the Variant's data stored in an Automation-compatible format.

Source is a TVarData record that represents the data from a Variant of this custom type.

As implemented in TCustomVariantType, CastToOle calls the OlePromotion method to determine the Automation-compatible type to which Source should be converted. It then calls the CastTo method to perform the actual conversion.

See Also