Basic4ppc Windows Mobile Shell command

jeterry

Member
Licensed User
Longtime 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.

Thanks
 

agraham

Expert
Licensed User
Longtime 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.
 

jeterry

Member
Licensed User
Longtime 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
 
Top