T
Thomas
Hi all,
I want to execute a new program in a c++ program without
beeing blocked. After the child process is created both
processes should run idependend.
My method at the moment:
execute( QString cmd )
{
int pid = -1;
pid = fork();
if(pid == 0)
{
execlp(cmd, NULL);
}
....
}
This works fine until I close the child process.
Then i get many errorreports in the console and the parent program hangs up.
errorexamples on my SuSe 9.1 Linux:
X Error: RenderBadPicture (invalid Picture parameter) 180
Major opcode: 153
Minor opcode: 5
Resource id: 0x3a00167
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 62
Minor opcode: 0
Resource id: 0x3a00166
Xlib: unexpected async reply (sequence 0x60cc)!
I tried to use the system(cmd) - command in the child process with
the same outcome.
Q: Why does quitting the child program effect my first program ?
Is there a method similar to system() which dosen't block the parent
process?
ps: can fork() be used under windows as well or do i have to use
createporcess()?
Thank for your time.
I want to execute a new program in a c++ program without
beeing blocked. After the child process is created both
processes should run idependend.
My method at the moment:
execute( QString cmd )
{
int pid = -1;
pid = fork();
if(pid == 0)
{
execlp(cmd, NULL);
}
....
}
This works fine until I close the child process.
Then i get many errorreports in the console and the parent program hangs up.
errorexamples on my SuSe 9.1 Linux:
X Error: RenderBadPicture (invalid Picture parameter) 180
Major opcode: 153
Minor opcode: 5
Resource id: 0x3a00167
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 62
Minor opcode: 0
Resource id: 0x3a00166
Xlib: unexpected async reply (sequence 0x60cc)!
I tried to use the system(cmd) - command in the child process with
the same outcome.
Q: Why does quitting the child program effect my first program ?
Is there a method similar to system() which dosen't block the parent
process?
ps: can fork() be used under windows as well or do i have to use
createporcess()?
Thank for your time.