Click to See Complete Forum and Search --> : Not running finishing code until another program quits running.
Aaron
January 12th, 2000, 03:39 PM
ODes anyone know of a quick way to keep part of a vb program from running until another part is done.. Like for instance i want to run a Perl script from a VB program. but I don't want the rest of the VB program to run until after the Perl script is finished. I know of a way to do it but I don't want to put in all that extra code in unless I really really have to.. I know I can check to see what processes are running but I don't want to do that unless I have to.. any thoughts?
Lothar Haensler
January 13th, 2000, 01:42 AM
I'd use the following approach:
- start the Perlscript via CreateProcess API
- add a Timer object to a form
- at regular intervals call WaitForSingleObject to see if the Perlscript has ended.
- if the return code of Waitfor... indicates that the object is finished, call CloseHandle and do whatever you want after the perlscript is finished.
Nick A.
January 13th, 2000, 02:55 AM
Here is a link
http://www.freevbcode.com/ShowCode.Asp?ID=99
I haven't tried it myself but i don't see any reason for it not to work.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.