Createprocess

B

Baskar

Hi,

My requirement is I have to run n number of precess in a loop. But all
processes should run in a chained manner, I mean only after the
previous process gets completed the next process should start and so
on.

So in a while loop I do as follow

while ( <condition> )
{
::CreateProcess(
NULL,
(LPTSTR)pszCmdLine,
NULL, NULL,
TRUE,
CREATE_NEW_CONSOLE,
NULL, NULL,
&si,
&pi);
}

But all the processes are running asynchrously. How to make it
synchronou? Please help.
Thanks in advance

Baskar
 
V

Victor Bazarov

Baskar said:
My requirement is I have to run n number of precess in a loop. But all
processes should run in a chained manner, I mean only after the
previous process gets completed the next process should start and so
on.

So in a while loop I do as follow

while ( <condition> )
{
::CreateProcess(
NULL,
(LPTSTR)pszCmdLine,
NULL, NULL,
TRUE,
CREATE_NEW_CONSOLE,
NULL, NULL,
&si,
&pi);
}

But all the processes are running asynchrously. How to make it
synchronou? Please help.

CreateProcess is not a standard function. You will be much better off
asking about it in a newsgroup dedicated to your OS or your compiler.
Judging from some syntax, comp.os.ms-windows.programmer.win32 is what
you want. Check it out.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top