Basic4ppc Windows Mobile Shell command

Discussion in 'Questions (Windows Mobile)' started by jeterry, Jun 18, 2015.

  1. jeterry

    jeterry Member Licensed User

    Does the shell command send any results back?

    I finally found a fix for the DEX serial issue and I am having to use another software package. I am calling the program using the shell comand. Works great by the way

    Just checking to see if there were any result codes passed back to the calling program.

  2. agraham

    agraham Expert Licensed User

    Shell cannot return any result codes as it starts the process and returns immediately before the process terminates. It would not be appropriate to wait for a result as that would stall the GUI thread and freeze your application unless called on a separate thread.

    If you want the return value when whatever you shell has terminated you need to use a Process object from my Threading library and invoke its Start and WaitForExit methods on a new Thread. It is not documented but a negative timeout waits forever but this is usually a bad idea. Looping on wait using Thread.Sleep and testing Process.Running is a better way to wait while deciding whether to Kill the process or not if it doesn't seem to be terminating.
    Erel likes this.
  3. jeterry

    jeterry Member Licensed User

    Thanks agraham. Look in you paypal account as I gave you a donation for this help and for the help on the serial issue. Serial issue by the way was what you said. They are sending a bunch of pre data information, problem is no one wants to tell you what they are.

    Thanks again
    Erel likes this.
  4. agraham

    agraham Expert Licensed User

    Thank you Jock, much appreciated. That will treat me to a couple bottles of Tesco wine on Special Offer :)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice