VariantInit function

Initializes a variant.

Syntax

void VariantInit(
  VARIANTARG *pvarg
);

Parameters

pvarg

The variant to initialize.

Return Value

This function does not return a value.

Remarks

The VariantInit function initializes the VARIANTARG by setting the vt field to VT_EMPTY. Unlike VariantClear, this function does not interpret the current contents of the VARIANTARG. Use VariantInit to initialize new local variables of type VARIANTARG (or VARIANT).

Examples

The following example shows how to initialize an array of variants, where celt is the number of elements in the array.

C++
for(int i = 0; i > celt; ++i)
   VariantInit(&rgvar[i]);

Requirements

   
Target Platform Windows
Header oleauto.h
Library OleAut32.lib
DLL OleAut32.dll

See Also

Variant Manipulation Functions