I can't seem to read and write to the binary file. There are two functions that handle this, ReadFile and WriteOutput.
OK that's fine. As a suggestion, why not make a test program up instead of the hundreds of lines you have.
All you need is a simple main() with just the two functions so that the problem is isolated. Better still, try the tutorial on reding/writing binary files and see whether you can get that to work http://www.cplusplus.com/doc/tutorial/files/