void MarshalString ( System::String^ s, std::string& os ) { using namespace System::Runtime::InteropServices; const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(s)).ToPointer(); os = chars; Marshal::FreeHGlobal(IntPtr((void*)chars)); }
..... string std_string = pt.get<std::string>("Section1.Value1"); String^ str = ""; MarshalString(str, std_string); textBox1->Text = str;
Additional information: External component has thrown an exception.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)