System.OleVariant

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

type OleVariant = { built-in type };

C++

class RTL_DELPHIRETURN OleVariant: protected Variant

Properties

Type Visibility Source Unit Parent
type
class
public
System.pas
sysvari.h
System System

Description

OLE-compatible Variant type.

OleVariant is an OLE-compatible Variant. The main difference between Variant and OleVariant is that Variant can contain data types that only the current application knows what to do with. OleVariant can only contain data types defined as compatible with OLE Automation, which means that contained data types can be passed between programs or across the network without worrying about whether the other end will know how to handle the data.

When you assign a Variant that contains custom data (such as a Object Pascal string, or one of the new custom variant types) to an OleVariant, the runtime library tries to convert the Variant into one of the OleVariant standard data types (such as a Object Pascal string converts to an OLE BSTR string). For example, if a Variant containing an AnsiString is assigned to an OleVariant, the AnsiString becomes a WideString. The same is true when passing a Variant to an OleVariant function parameter.

See Also