CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 1999
    Posts
    21

    Not running finishing code until another program quits running.

    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?


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Not running finishing code until another program quits running.

    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.


  3. #3
    Join Date
    Dec 1999
    Posts
    128

    Re: Not running finishing code until another program quits running.

    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.

    -------------------------
    Nick A.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured