Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- From: kjnilsson@xxxxxxxxx
- Date: 17 Jan 2007 01:17:26 -0800
Try
b = (_bstr_t)tvar;
Thanks Stephen that was exactly it! I wonder what .bstrVal is for
though if not for converting to a _bst_t - ah well...
std::cout << b;
That will not work. std::cout does not know about _bstr_t.
actually it does work in the vc7 implementation but I'll make a note
not to do it anyway.
cheers
Karl
Stephen Howe wrote:
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:
- Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- From: Stephen Howe
- Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- References:
- Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- From: kjnilsson
- Re: Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- From: Stephen Howe
- Prorblem assigning _variant_t to _bstr when _variant_t is an integer
- 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):