J jeterry Member Licensed User Longtime User Jun 18, 2015 #1 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. Thanks
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. Thanks
agraham Expert Licensed User Longtime User Jun 18, 2015 #2 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.
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.
J jeterry Member Licensed User Longtime User Jun 18, 2015 #3 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
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
agraham Expert Licensed User Longtime User Jun 18, 2015 #4 Thank you Jock, much appreciated. That will treat me to a couple bottles of Tesco wine on Special Offer
Thank you Jock, much appreciated. That will treat me to a couple bottles of Tesco wine on Special Offer