How to Change Type of a VARIANT
- by nimo
Hi,
I'm having a VARIANT with its type set to VT_R8. Subsequently I need to change its type to VT_BSTR.
I would like know whether there is a way of resetting a VARIANT status.
Thus, I noticed that every time I set value to the VARIANT (in my case, its double) , VARIANT itself set its bstrVal member to a bad pointer, even though I set bstrVal member to NULL at the initialization of VARIANT. Why such thing is happening ?
Is it safe to use a VARIANT as structure where both dbVal and bstrVal member are set ?
Please clarify, thank you.