Im trying to find out how to convert a SYSTEMTIME to BSTR. Cant find
out how to do that.
I'm assuming you're referring to the SYSTEMTIME struct in the Windows
API (The C++ equivilent is struct tm in <time.h>, which you should
consider using instead if appropriate.), and the BSTR struct which
represents a Visual Basic string, often used in COM/OLE.
Generally, the procedure here is to format from the time struct into
an ordinary std::string using std:

stringstream in whatever format
you require. Convert the std::string into a C string using the
c_str() member, and convert that C string into a BSTR using _bstr_t in
<comutil.h>, which most Windows compilers provide. Alternately, you
can use the BSTR manipulation functions that are part of the base OLE
API.
Whatever you do, don't just pass a C string as a BSTR. Even though
this will not generate a compile-time diagnostic, it is invalid, and
will lead to problems.
Aaron W. LaFramboise