Here is my need
BSTR l_strArgs;
LPCWSTR sth;
//----
//---
OutputDebugStringW(sth);
How to convert BSTR to LPCWSTR ?
Is there any header only library that coverts any string type(microsoft) to LPCWSTR type ?
Just cover NULL scenario and you're good to go
BSTR l_strArgs;
LPCWSTR sth = strArgs ? strArgs : L"";
As you mentioned ATL in the tag, here is ATL-style one-liner:
OutputDebugString(CString(l_strArgs));
or, to make sure you are staying in Unicode domain:
OutputDebugStringW(CStringW(l_strArgs));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With