L
Lee J
Gang,
I am self taught in C and fairly proficient for last 20 years. Don't
program much, just little utilities for work. Been wanting to create
windows forms and found MS VC++ Express. Installed it, bought book, etc.
Book doesn't cover files. From other sources I have the following:
#pragma once
#include <string>
#include <fstream>
//in a buttonclick function
std::ifstream infile;
String^ testText;
openFileDialog1->ShowDialog(); //Search for file and put name in
textBox1->Text = openFileDialog1->FileName; // a textbox on the form and in
testText = textBox1->Text; // a text variable.
I then want to open the file listed in textBox1 and testText.
infile.open(testText);
That doesn't work. I get an error, C2664
I am totally confused by different strings, different ways of opening files,
managed, unmanaged .....
I created the project as just a CLR Windows Forms Application in VC++
Express. All I need to do is get a filename from openFileDialog into a
textbox for reading and another for writing from another textbox, read the
lines from one file, manipulate the string a bit and write it out to the
other.
Any help appreciated.
Lee
I am self taught in C and fairly proficient for last 20 years. Don't
program much, just little utilities for work. Been wanting to create
windows forms and found MS VC++ Express. Installed it, bought book, etc.
Book doesn't cover files. From other sources I have the following:
#pragma once
#include <string>
#include <fstream>
//in a buttonclick function
std::ifstream infile;
String^ testText;
openFileDialog1->ShowDialog(); //Search for file and put name in
textBox1->Text = openFileDialog1->FileName; // a textbox on the form and in
testText = textBox1->Text; // a text variable.
I then want to open the file listed in textBox1 and testText.
infile.open(testText);
That doesn't work. I get an error, C2664
I am totally confused by different strings, different ways of opening files,
managed, unmanaged .....
I created the project as just a CLR Windows Forms Application in VC++
Express. All I need to do is get a filename from openFileDialog into a
textbox for reading and another for writing from another textbox, read the
lines from one file, manipulate the string a bit and write it out to the
other.
Any help appreciated.
Lee