Jul 10

How to convert a character array to a BSTR?

I explain to you how to convert a character array to a BSTR.

char g_url[512] = “”;

BSTR oURL;

You could use the CT2W macro:

oURL = SysAllocString(CT2W(g_url));

This macro is defined in ATL header files #include <atlbase.h>

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Twitter

Related Posts:

  1. How Casting from std:string to char*

Leave a Reply