> But the pre-compiler program can do the same: save the compiler program ProcessID and make it
> a child process. When the editor closes the pre-compiler, compiler will also close, won't it?
No, it won't.
First:
The Editor ends the Compiler with 'TerminateProcess' which means, that this 'fake'Compiler won't have any time to close the 'real' Compiler by itself (for example with another TerminateProcess call).
Second:
the Compiler being a Child Process of this 'fake'Compiler doesn't mean, it is closed, if it's parent is closed. This only means, that the Parent Process can share some stuff like Environmental Variables an such.
You see, if the Editor uses TreminateProcess to close your 'fake' Compiler, the 'real' Compiler keeps running.From Microsoft Platform SDK (about TerminateProcess)
Terminating a process does not cause child processes to be terminated.
Timo