Hi,
I'm a real newbie at C++, and I'm having a ton of trouble.
You see, What I need to do is convert an std::string into a system::string^ so I can display it in a textbox, and I haven't found any way of doing so :icon_confused: . I always get the compiler error 'cannot convert parameter 1 from 'std::string' to 'system::string ^'
I've searched on google, and they give a million ways to do the opposite of what i want to do. I'm using Visual C++ 2008 with .NET Framework 3.5. Here's my code:
int method;
int x = 53;
int y = 85;
private: System::Void btnCalc_Click(System::Object^ sender, System::EventArgs^ e) {
if(this->radioButton1->Checked == true)
if(this->radioButton2->Checked == false)
if(this->radioButton3->Checked == false)
if(this->radioButton4->Checked == false)
{
method = x + y;
std::string txtboxstring; // Converts 'method' (int)
std::stringstream out; // into std::string
out << method;
//NEED TO CONVERT STD::STRING TO SYSTEM::STRING ^
this->txtresult->Text = txtboxstring;
}
}
Well, that's it. Thanks in advance to anyone who can help.
btw, yes, I know there are capitals on system::string, but I can't cuz it just gives the :S Icon.