Questions tagged [bstr-t]
6 questions
3
votes
1 answer
Handling _bstr_t from byte array and back with C#
I try to decrypt a given file, but the content stored is done in C++ using the _bstr_t class. I've been searching for 2 hours already, testing everything and I still didn't get the correct result: reading Korean _bstr_t'd characters as String.
This…

Diamondo25
- 769
- 1
- 8
- 21
3
votes
1 answer
Can I use the _bstr_t class to convert between multibyte and Unicode on Windows? (C++)
BSTR is this weird Windows data type with a few specific uses, such as COM functions. According to MSDN, it contains a WCHAR string and some other stuff, like a length descriptor. Windows is also nice enough to give us the _bstr_t class, which…

melanie johnson
- 597
- 3
- 16
1
vote
2 answers
How to concatenate string in _bstr_t and wchar_t?
I have _bstr_t string and I have wchar_t and one unsigned int variables which I want to put to the string...
_bstr_t strCnn("Driver={SQL Server};Server=some_host,some_port;Database=some_db;User ID=some_user;Password=some_psw;");
wchar_t…

Nikola
- 29
- 5
0
votes
1 answer
Get number of columns in C++ with _bstr_t and ADO
I am using Visual Studio 2008, and SQL Server, Currently I have a connection using ADO, but would like to retrieve the number of columns a table has...
Here is what I have
/*CODE FOR connecting to database**/
/*query to know number of columns in…

edgarmtze
- 24,683
- 80
- 235
- 386
0
votes
1 answer
Converting _bstr_t to float in C++
I need to convert a _bstr_t that comes from the DB (ADO) to float, have a look at the code segment:
_bstr_t valueDB = productsDB->Fields->GetItem("Value")->Value;
float referenceFloatValue = productsDB->Fields->GetItem("Value")->Value.fltVal;
I'm…

MGE
- 872
- 1
- 8
- 14
-3
votes
1 answer
C++ how to convert a char[] array to _bstr_t?
I want to convert a char array, e.g. char myArray[size] to a _bstr_t string. I tried this, but it doesn't work:
_bstr_t test;
for (int i = 0; i < myArrayLength; i++) {
test = test + (_bstr_t) myArray[i];
}

niko85
- 303
- 2
- 12