variant types..
-
guys i have a variant..being returned by a method..how do i get its vt..and also how do i then extract the value from this variant.. thanks -anand
If
v
is the variable theVARIANT
is returned in, thenv.vt
is the type (VARTYPE
) VARIANT and VARIANTARGIan Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - me -
If
v
is the variable theVARIANT
is returned in, thenv.vt
is the type (VARTYPE
) VARIANT and VARIANTARGIan Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - mehey thanks ian.. one more thing plz..how do i then get the value from this variant? thanks
-
hey thanks ian.. one more thing plz..how do i then get the value from this variant? thanks
Depends what it is. There are various macros beginning V_ that you might find useful. Say you have VARIANT v; HRESULT x = myobj.mycall(...,...,..., &v); You can have code like this: switch(V_VT(&v)) { case VT_BSTR: // Returned a string // V_BSTR(&v) is the BSTR being passed back... break; case VT_I4: // Returned a 'long' // V_I4(&v) is the number and so on. Does that help? Steve S
-
Depends what it is. There are various macros beginning V_ that you might find useful. Say you have VARIANT v; HRESULT x = myobj.mycall(...,...,..., &v); You can have code like this: switch(V_VT(&v)) { case VT_BSTR: // Returned a string // V_BSTR(&v) is the BSTR being passed back... break; case VT_I4: // Returned a 'long' // V_I4(&v) is the number and so on. Does that help? Steve S
Dang! You beat me to it ;)
Ian Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - me -
Dang! You beat me to it ;)
Ian Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - me