Converting a BSTR to System::Object, How???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am using mixed mode C++ and I wonder.... How could I convert a BSTR to a System::Object* type

Cheers,
 
Jim said:
Hi,

I am using mixed mode C++ and I wonder.... How could I convert a BSTR to a System::Object* type ?

Cheers,

One way is to use ATL's CString :

<include atlstr.h>

BSTR bsTest;
CString csTest=(WCHAR*) bsTest;
System::Object* oTest=(System::String*) csTest;

Hope this helps,

Michiel.
 
Back
Top