I am simply trying to convert _bstr_t into std::string..
I found a post on this issue (LINK), and did exactly as described, but it is raising exception..
This is what I did:
_bstr_t BString;
std::string STDString((char *) BString);
And I get this error:
0CxC00000005: Access violation reading location 0x00000000
Specifically, after looking at the call stack, error in iosfwd.h:
static size_t __CLRCALL_OR_CDECL length(const _Elem *_First)
{ // find length of null-terminated string
return (*_First == 0 ? 0
: _CSTD strlen(_First));
}
What is the right way to convert _bstr_t to std::string..?
Thanks