I'm very new to C++. I use Code::Blocks and I need to show a BSTR value with MessageBox function.
I tried to google this question but did not found a suitable answer.
How to do this?
I'm very new to C++. I use Code::Blocks and I need to show a BSTR value with MessageBox function.
I tried to google this question but did not found a suitable answer.
How to do this?
BSTR is wchar_t*
, as far as MessageBox is concerned, so you can pass it directly to MessageBoxW. MessageBoxW(hwnd,bStrVal,...);
For MessageBoxA
, you must convert with WideCharToMultiByte
.
Suggestion: use always unicode in your apps, never leave it.