Partage via


ComVariant.CreateRaw<T>(VarEnum, T) Méthode

Définition

Créez un ComVariant avec le type donné et la valeur fournie.

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

Paramètres de type

T

Type de la valeur à stocker dans la variante.

Paramètres

vt
VarEnum

Type de la variante

rawValue
T

Valeur brute à stocker dans la variante sans traitement

Retours

Variante qui contient la valeur fournie.

Exceptions

Lorsque le vt fourni correspond à un type de variante qui n’est pas pris en charge dans VARIANTs ou qui est VT_DECIMAL

Lorsque le vt fourni spécifie l’indicateur de VT_ARRAY pour SAFEARRAYs.

S’applique à