That is what I thought at first. But why does the vector print correctly when it is to the console and incorrectly when it is to a file, and the two commands are right next to each other. Where was the opportunity to screw up the Subtractions vector?
I cannot get that to build, the compiler does not know NEW or DBG_NEW. But either way that is a rather complex class. However, I can see nothing obvious, I guess the only way to find the problem is via the debugger.
OK, with a bit of editing I got it to work and the output is correct (as far as I can see) in both cases.
So the issue must have something to do with what you are running, or your data.
The reason being is executable viruses have a nasty habit of hiding themselves from attempts to find them. File system reads/writes get redirected to what looks like good data, so your attempts to find them will actually find nothing.
It's far better to rely on actual anti-virus software, which protects the actual file system code from attempts to redirect/replace it. That's something your code cannot do when a user launches it.
I downloaded it built it debug x64 and as I was stepping thru that code it got an exception it was somewhere in MFC code the call stack indicated it was from an Additem Ill go back and try to fix it up thank you
-first, the dwSemCount value si always printed as 0, even if the semaphore works fine
-second, incrementing the counter with ReleaseSemaphore function from inside of thread doesn't working, I can't explain why.