A BSTR (Basic string or binary string) is a string data type that is used by COM, Automation, and Interop functions. A BSTR is a composite data type that consists of a length prefix, a data string, and a terminator.
Use the AllocSysString member function of the CString to convert from CString to BSTR:
Code:
CString cs("Hello");
BSTR bstr = cs.AllocSysString();
Note: If you use the 'BSTR' by yourself, dont forget to call '::SysFreeString()' when you're done with it.