2012年3月19日 星期一

windows form get textBox text

將textBox.text回傳system string轉換為char*
------------------------------------------------------

char* inputText = (char*) Marshal::StringToHGlobalAnsi(textBox1->Text).ToPointer();

Marshal::FreeHGlobal(IntPtr(inputText));//free


並加入
using namespace System::Runtime::InteropServices;