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.
Code:
String ^rd;
std::string read;
read = "abcd";
rd = read.c_str();
error:
Code:
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
PS - using visual c++ 2005 express
Thanks!