- VariantClear:释放当前的变量内容后,置类型为VT_EMPTY
Use this function to clear variables of type VARIANTARG (or VARIANT) before the memory that contains the VARIANTARG is freed (as when a local variable goes out of scope).
The function clears a VARIANTARG by setting the vt member to VT_EMPTY and the wReserved member to 0. The current contents of the VARIANTARG are released first.
If the vt member is VT_BSTR, the string is freed.
If the vt member is VT_DISPATCH, the object is released.
If the vt member has the VT_ARRAY bit set, the array is freed.
- VariantInit:仅变量类型为VT_EMPTY
Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application.
The VariantInit function initializes the VARIANTARG by setting the vt member to VT_EMPTY.
Unlike VariantClear, this functiondoes not interpret the current contents of the VARIANTARG.
Use VariantInit to initialize new local variables of type VARIANTARG (or VARIANT).