COM.RBVariantToVARIANT

From Xojo Documentation

Method

COM.RBVariantToVARIANT(v As Variant, addByref As Boolean = False) As MemoryBlock

Supported for all project types and targets.

Converts an RB Variant to an OLE VARIANT. If addByref is True then the VARIANT type will include VT_BYREF.

Example

// oleVar holds an OLE VARIANT which contains a BSTR that needs to be freed
Var oleVar As MemoryBlock = COM.RBVariantToVARIANT("test")

// ... use oleVar

COM.FreeVARIANT( oleVar )