View Single Post
  #1  
Old January 20th 07, 12:43 PM posted to microsoft.public.outlook.program_addins
lencastro
external usenet poster
 
Posts: 8
Default how to convert 'System::String ^' to 'BSTR'

i am creating a addin for outlook express in vc++2005

I am trying to load xml to my code with the following code

STDMETHOD(GetCustomUI)(BSTR RibbonID, BSTR * RibbonXml)
{
Assembly^ assem=Assembly::GetExecutingAssembly();
Stream^ strm=
assem-GetManifestResourceStream("test.Xmlres.test.xml") ;
StreamReader^ reader= gcnew StreamReader(strm);
*RibbonXml= reader-ReadToEnd();
reader-Close();
strm-Close();
return S_OK;

}


but it showing an error in compile time:

error C2440: '=' : cannot convert from 'System::String ^' to 'BSTR'
No user-defined-conversion operator available, or
Cannot convert a managed type to an unmanaged type

Ads