Sending the
BSTR
direct to the insertion operator is causing you this problem since it is not a recognised type. Convert it to a proper character pointer and it should work. Note that (assuming
myfile
is an instance of
ofstream
that there is no overload that accepts a wide string, as seen
here[
^].