Hi Guys,

I am running vc in visual studio 2009. I have a code that I wrote to read a binary file a while back using c++ (all in a console). Now I am trting to update the code using a GUI. In the console version the file location was hardcoded.

FILE *stream;
char fileName[100] = "c:\\.........";
stream = fopen(fileName,.....)

BUt and now I am using the openDialogBox to get the file and put the file name in a textbox.

I figured that I could just resuse my previous code completely by only changing the fileName setup. So I tried this

char fileName[100] = textBox->Text->ToCharArray();

This does not work. I have tried array<char>^ fileName also.

So if anybody can help me on how to get the text out of a textbox into a format for the fopen(), it would really appreciate.

You clearly didn't do much searching before posting here, because MSDN has a knowledgebase article on this exact subject.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.