FILE * myfile1 = fopen ( System::String(textBox1->Text) ,"rb" );
error C2440: '<function-style-cast>' : cannot convert from 'System::String ^' to 'System::String'
How do i convert this properly?
You could use the Marshal conversion ...
example :
1 2 3 4 5 6 7 8 9
|
#include <msclr\marshal_cppstd.h>
using namespace msclr::interop;
using namespace std;
using namespace System;
System::String ^ fileText = textBox1->Text;
std::string converted_fileText = msclr::interop::marshal_as< std::string >(fileText);
|
Last edited on