Getting a string from a VARIANT 
Author Message
 Getting a string from a VARIANT

I have an ActiveX control that returns a VARIANT from a method how do I get
the string value from the VARIANT?

Thanks!
Kurt



Mon, 13 Oct 2003 23:17:02 GMT  
 Getting a string from a VARIANT
VARIANT var;

ASSERT(V_VT(&var) == VT_BSTR);
BSTR bstr = V_BSTR(&var);

--
With best wishes,
    Igor Tandetnik


Quote:
> I have an ActiveX control that returns a VARIANT from a method how do I
get
> the string value from the VARIANT?

> Thanks!
> Kurt



Mon, 13 Oct 2003 23:24:25 GMT  
 Getting a string from a VARIANT
There is one good place in MSDN where you can find detailed information of
VARIANT structure. Please refer to MSDN->Platform SDK->Component
Services->COM->Automation->Data Types, Structures, and
Enumerations->IDispatch Data Types->VARIANT and VARIANTARG.

Hope it helps.

yhhuang
ICQ:91074870



Tue, 14 Oct 2003 14:21:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VARIANT String assign to STL string

2. Getting a String Out of a String Stream (ostringstream)

3. Sending an Array of Strings as a Variant

4. STRING[VARIANT] FROM ASP

5. Passing An Array of String or Variant

6. Converting VARIANT date to string representation ?

7. Converting from Variant to Simple String in C++ COM

8. how to convert string to VARIANT ?

9. convert VARIANT to character string

10. is this string / Variant usage bad or good?

11. VARIANT output parameter doest recognize String VB data type

12. How to access strings in VARIANT array?

 

 
Powered by phpBB® Forum Software