I\'m using C++ cli and have a function in MyForm.cpp like this:
void test(char* h) { std::string str = h; String^ str3 = gcnew String(str.c_str()); MessageBox::Sh