Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Calling exes from Visual Basic

  • 13-01-2005 10:37AM
    #1
    Registered Users, Registered Users 2 Posts: 1,368 ✭✭✭


    Hey Guys,

    I have written some imaging processing code in Visual Basic

    The code calls some .exes to convert a .bmp image to a certain custom file format.

    This program convert.exe is exeuted twice from the VB program to convert two seperate images. I don't think I can call the exe on both images at the same time, so is there anyway of checking (within my VB code) if the program has finished executing on the first image, before I call it for the second?

    Cheers,
    Martin


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    How are you launching the exe's? You can attach to a process through the API so you can tell when its finished. I don't know if you can do that when using the Shell function its been a while since I've done VB. I may have code at home somewhere.


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    Shell is asynchronous-only, IIRC.
    I seem to remember needing to trawl the various code sites for exactly this...but its definitely there.

    king_of... do a google for "synchronous Shell Visual Basic sample" or somesuch and see how you get on.

    Synchronous shell will - for info - not return control to the VB program until the shelled app has completed.

    Alternately, look up how to get a list of running processes and then search the list for the .exe...again, its an API call or three.

    jc


Advertisement