Hmm, well, the simplest way for you might be just to write another C++ program that does the following:
starts, and makes sure that either
1. there are no left-over output files from the other program, or
2. that if there is a left-over output file it gets renamed properly right away.
Use
CreateProcess() (#include <windows.h>) to start the other program and get its PID.
Loop:
- Check to see if the file reappears. If it does, rename it.
- You might want to look through this thread:
http://www.daniweb.com/forums/thread125002.html
- Check to see if the program has terminated. If it has, you are done.
On Windows, you can use
WaitForMultipleObjectsEx() to wait for both file changes and program termination, and respond appropriately depending on which event occurred.
Good luck.