C ++ / cli将LPCSTR转换为System :: String ^

时间:2012-07-27 19:59:22

标签: c++ string c++-cli marshalling lpcstr

我将LPCSTR转换为System :: String ^时遇到问题,但我可以将System :: String转换为带Marshal的LPCSTR。

但我怎样才能将LPCSTR转换为System :: String ^

谢谢

1 个答案:

答案 0 :(得分:7)

gcnew System::String(lpcstrThing);