Child Processes

BlitzPlus Forums/BlitzPlus Programming/Child Processes

schilcote(Posted 2010) [#1]
I'm writing a program that uses ExecFile to multithread. The task I want it to perform (web spider) will probably take some time, and the user might want to stop in the middle. Now, if the user hits the X button on the main process' console window, will all the threads die or just the main one? Should I use CreateProcess instead?


Matty(Posted 2010) [#2]
Anything started with Exec file will not stop when the calling program stops...it simply runs as if executed from Windows..


Stamm(Posted 2010) [#3]
use CreateProcess() instead, it will return you a stream to communicate with the other process via Microsoft's DDE protocol.
the child process communicates via Input() and Print().
so in the child process, just do something like

repeat
in$=input()
;do your stuff
until in="end"

i have tried this, it works