Take a look at main();
You open and close the files. You don't actually have any code to alter the files.
#include "WriteFile.h" needs to be in Proj4.cpp.
Then you need to actually use it inbetween the open and close file.
The a.out is done manually on the command line. It takes cout and puts it into a file.
You call the function by calling the function. None of the standard library code is mysteriously invoked for your code with the correct parameters -- you have to call it. Having the source code in the project is not calling the function.
In your fifth post, the line you've bolded and marked "took this out" you call the function, although calling the function from within the function is not something you want to do here. You need to call it from main.