Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Calling exes from Visual Basic

Options
  • 13-01-2005 11:37am
    #1
    Registered Users Posts: 1,366 ✭✭✭


    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 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 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