Redigera

Dela via


ComVariant.CreateRaw<T>(VarEnum, T) Method

Definition

Create a ComVariant with the given type and provided value.

public:
generic <typename T>
 where T : value class static System::Runtime::InteropServices::Marshalling::ComVariant CreateRaw(System::Runtime::InteropServices::VarEnum vt, T rawValue);
public static System.Runtime.InteropServices.Marshalling.ComVariant CreateRaw<T> (System.Runtime.InteropServices.VarEnum vt, T rawValue) where T : struct;
static member CreateRaw : System.Runtime.InteropServices.VarEnum * 'T -> System.Runtime.InteropServices.Marshalling.ComVariant (requires 'T : struct)
Public Shared Function CreateRaw(Of T As Structure) (vt As VarEnum, rawValue As T) As ComVariant

Type Parameters

T

The type of the value to store in the variant.

Parameters

vt
VarEnum

The type of the variant

rawValue
T

The raw value to store in the variant without any processing

Returns

A variant that contains the provided value.

Exceptions

When the provided vt corresponds to a variant type that is not supported in VARIANTs or is VT_DECIMAL

When the provided vt specifies the VT_ARRAY flag for SAFEARRAYs.

Applies to