Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Mon, 15 Jan 2007 13:23:33 -0000
if(tvar.vt == VT_NULL) b = "";
else b = tvar.bstrVal;
Try
b = (_bstr_t)tvar;
Any good?
In general, you don't to mess about with the guts of _variant_t and _bstr_t
but instead use the conversion constructors
provided for you.
std::cout << b;
That will not work. std::cout does not know about _bstr_t.
Change that to
std::cout << (const char *)b;
Stephen Howe
.
- Follow-Ups:
- References:
- Prev by Date: Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- Next by Date: Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- Previous by thread: Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- Next by thread: Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- Index(es):