April 9th, 2010, 08:36 AM
How to determine if VARIANT contains an Array?
I have a problem regarding VARIANTS. What I want to do is how to determine if a VARIANT contains an array. I want to do this because I am accessing a WMI variable and sometimes, the returned variable is an array, which will then be put into the VARIANT.
I tried doing this:
if(V_VT(&vtProp) == VT_ARRAY)
cout << "VTPROP IS AN ARRAY" << endl;
else if(V_VT(&vtProp) == VT_BSTR)
cout << "VT PROP IS AN BSTR" << endl;
But it does not correctly identify if the VARIANT contains an array. However, it does correctly identify if the VARIANT is a BSTR.
Can anyone help me?
Thank you all!
Tags for this Thread
Click Here to Expand Forum to Full Width