I am having trouble trying to figure out how to get a console app into a windows version of C++. My code basically takes a txt file and manipulates it to remove a form feed char and add 20 blank lines. I can do this easy in a console app like this:
Code:
#include "stdafx.h"
#include "iostream.h"
#include "fstream.h"
ifstream infile;
ofstream outfile;
int main(int argc, char* argv[])
{
char next;
infile.open("C:/test.txt");
outfile.open("C:/outfile.txt");
infile.get(next);
while (! infile.eof())
{
if (next == (char)12)
{
int cnt;
for (cnt = 1; cnt <= 20; cnt++)
outfile << "\n";
}
else
outfile.put(next);
infile.get(next);
}
infile.close();
outfile.close();
return 0;
}
How would i get this into, say, a simple windows program, like a single document MFC wizard program to process this code when i open the file? I read alittle on serialization but dont have any examples to work with.