Getting a std string into a String^
Hi, I am trying to set the text of a textbox but textboxes only take String^ not std::string. I have a function to change a String^ into a std::string but not vice versa. According to this you can simply do: String^ s = somestring.c_str(). Here is my code followed by the error.
read = "abcd";
rd = read.c_str();
PS - using visual c++ 2005 express
c:\documents and settings\ac251404\my documents\visual studio 2005\projects\project1\project1\Form1.h(590) : error C2440: '=' : cannot convert from 'const char *' to 'System::String ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type