VariantInit function (oleauto.h)
Initializes a variant.
Syntax
void VariantInit(
[out] VARIANTARG *pvarg
);
Parameters
[out] pvarg
The variant to initialize.
Return value
None
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.
for(int i = 0; i < celt; ++i)
VariantInit(&rgvar[i]);
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | oleauto.h |
Library | OleAut32.lib |
DLL | OleAut32.dll |