I have a non-unicode (MBCS) C++ project building with VS2013.
Given a BSTR
value, how should I pass this to printf safely?
A BSTR
really is a WCHAR*
with preceding length information. You can ignore that length part for printing purposes. So:
BSTR str = foo();
printf("%S", str); // Capital S