Platform to char* and char* to Platform

丁钟展
2023-12-01

char* to Platform::String^
    char * p = "";
    std::string path_str(p, p+strlen(p));
    _bstr_t t = path_str.c_str();
    wchar_t* pwchar = (wchar_t*)t;
    std::wstring result = pwchar;
    String^ MyStr = ref new String(result.c_str());
Platform::String^ to char*
    std::wstring ws = std::wstring(MyStr->Data());
    std::string s;
    s.assign(ws.begin(), ws.end());
    char *p = a.c_str();

 类似资料:

相关阅读

相关文章

相关问答