I am writing a program that has some functions in it to open, read and then search through lines in a file. It will be a txt file.
Currently I am trying to find a way to pass the Open file to the ReadFileLine function, so that it can then go through the file, line by line, passing each line to a function which searches for specific words in this line. I hope you're following me?
The file is opened using the following code:
OpenFileDialog^ OpenFile = gcnew OpenFileDialog;
OpenFile->InitialDirectory = "c://";
OpenFile->Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
OpenFile->FilterIndex = 2;
OpenFile->RestoreDirectory = true;
if (OpenFile->ShowDialog() == ::StatsReading::DialogResult::OK)
if( (mystream = OpenFile->OpenFile()) != nullptr)
Now how do I get an event raised or a pointer to this open file that I can use in the function which will take a line from this file to do something with??
Please give me some example code if possible?
I am writing in Visual C++.net Express.