int fun(CString str)
{
   //调用fun2
   fun2(WString wstr);
}
str参数要传给wstr   请问 怎么才能把CString 的 str 转换为 wstring 的 wstr ?请大家帮帮忙~~ 多谢!

解决方案 »

  1.   

    CString a;
    CStringW b = a;
    wstring c = (LPCWSTR)b;
      

  2.   

    fireseed(奶油狗【奥伊斯特拉赫的声音简直不可思异!】) 
    CString a;
    CStringW b = a;
    wstring c = (LPCWSTR)b;要加一点特点说明:
       要求你的工程字符集设置为unicode 才行缺省为多字节。  .net 中设置方法: class view -> rclick: select property -> reqularly ....
    如果是多字节: 用MultiByteToWideChar  转