Quote Originally Posted by Pahanuch View Post
Thank U. I decided this problem

Code:
std::string str;
 
                 const char* temp = (const char*)(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(textBox1->Text)).ToPointer();
                 str = temp;
                 System::Runtime::InteropServices::Marshal::FreeHGlobal(IntPtr((void*)temp));
 
                 textBox2->Text = gcnew String(str.c_str() );
(sorry for the smiley overkill... )

This crude mix of managed and native code is by far the creepiest example of that "technique" I've ever seen!

And it's functionally exactly equivalent to this:

Code:
textBox2->Text = textBox1->Text;
You'd probably have been much quicker simply looking up the correct C++/CLI syntax for working with reference types like System::String than digging out all that (in this context absolutely counter-productive) interop stuff.