Question: How to handle Varinat passed to COM components?
Answer: A pointer to another VARIANTARG is passed in pvarVal. This referenced VARIANTARG will never have the VT_BYREF bit set in vt, so only one level of indirection can ever be present. This value can be used to support languages that allow functions to change the types of variables passed by reference.
inline VARIANT * GetVARIANT(VARIANT * v) { while( v && v->vt == (VT_BYREF|VT_VARIANT) ) v = v->pvarVal; return v; }
Question:
How to handle Varinat passed to COM components? Answer:
A pointer to another VARIANTARG is passed in pvarVal. This referenced VARIANTARG will never have the VT_BYREF bit set in vt, so only one level of indirection can ever be present. This value can be used to support languages that allow functions to change the types of variables passed by reference.
inline VARIANT * GetVARIANT(VARIANT * v) { while( v && v->vt == (VT_BYREF|VT_VARIANT) ) v = v->pvarVal; return v; }