请问BSTR类型的字符串怎么输出?我用Format函数输出时只能输出一个字符。请各位高手多多指教。

解决方案 »

  1.   

    USES_CONVERSION;
    SetWindowText(OLE2CT(bstrCaption));
      

  2.   

    比较复杂
    刚了解一点儿
    别人叫我的
    http://expert.csdn.net/Expert/topic/1732/1732820.xml?temp=.5617639
      

  3.   

    用_bstr_t来转换。BSTR str;
    SetWindowText(_bstr_t(str));
      

  4.   

    谢谢各位,我的问题已经解决。
    BSTR Name;
    CString cstr((LPCWSTR)Name);
    MessageBox(cstr,NULL,MB_OK);
      

  5.   

    USES_CONVERSION;
    BSTR str1;
    _bstr_t str2;...
    str2 = W2A(str1);file<<str2<<endl;
    ...