I have 3 programs:
filesrc.exe : This file reads a text file and spits out all data
filefilter.exe : This file takes in data coming from filesrc.exe and does few checks and then spits it out
filewrite.exe: This file takes in data coming form filefilter and then puts it in some file.
(Thats how i should copy one file to another)
I have all the above 3 files working but can't figure out how will i write one main application to control the above 3 files. In other words i want to make a main file that would execute the above programs and properly pass on the required data to one another using handles , CreateProcess() and CreatePipe().
So far i have this much(below), but i am lost as to how will i hand over a handle from one process to another( data bouncing in b/w the above three files). More or less copy file from one to another with the help of above files and in above mentioned manner.
int main(int argc, char *argv)
pipeAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
pipeAttr.bInheritHandle = TRUE;
pipeAttr.lpSecurityDescriptor = NULL;
if (! CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &pipeAttr, 0))
cout << "error creating pipe" << endl;