Hi, I am writing a piece of code to open a file and retrieves its name:
OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog;
if ( openFileDialog1-> ShowDialog() == System::Windows:: Forms:: DialogResult:: OK )
System:: String^ fileName = openFileDialog1->FileName;
but later I realized that the String^ fileName can't be used as char* directly, the compiler says:
Cannot convert a managed type to an unmanaged type
Does anyone know how I can do the conversion?
Thanks a lot!