是否有一种简单的方法(一行代码很酷)将àstd :: string转换为C++/CX中的Platform :: String^?C++/CX:将std :: string转换为Platform :: String^
我找到了how to do it the other way(字符串^到字符串),但没有为这一个。
喜欢的东西:
std::string str = "Hello World";
Platform::String^ p_str = convertFromString(str);
(在这是毫无意义的,但比如当你用的std ::在C++字符串的情况下想将它发送到一些C#代码,它更有意义)
你总是可以尝试使用一个charArray它们之间的转换? – Cjen1
感叹,22年的Unicode并不能阻止这样的问题。您已经知道如何从该帖子转换为std :: wstring。然后它是一个单线程,ref新的字符串(wide.c_str()) –
我可以做其他工具(用char *等等......),但我想知道是否有一个好/简单的方法它 – ashtrail