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 |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for