G
George
How do I call a function that returns a string in managed C++
This for example is very wrong.
private: System::Void button1_Click(System::Object * sender,
System::EventArgs * e)
{
string str;
str= GetTextMessage;
MessageBox(0,str.data(),"Test",MB_OK);
}
private: System::String GetTextMessage()
{
string str("Hello ");
str+="World";
return str;
}
This for example is very wrong.
private: System::Void button1_Click(System::Object * sender,
System::EventArgs * e)
{
string str;
str= GetTextMessage;
MessageBox(0,str.data(),"Test",MB_OK);
}
private: System::String GetTextMessage()
{
string str("Hello ");
str+="World";
return str;
}