Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recognising completion of another program
Message
From
10/12/2001 04:40:20
 
 
To
10/12/2001 02:35:32
Andrew Mcgurk
Zermatt Business Systems
Wyoming, Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00591923
Message ID:
00591972
Views:
30
>>>From a button on a form I RUN another Windows program which downloads a text file from a barcode reader(via serial port).
>>>
>>>I don't want my code to continue running until the barcode program finishes.
>>>
>>>How can I recognise this completion?
>>>
>>>TIA
>>>Andrew McGurk
>>
>>See file #9477 in the download section.
>>
>>Dan
>
>Thank you for your quick and appropriate response. It looks straight forward, but in my ignorance, it doesn't work for me!
>
>I am setting the following properties
>
> ThisForm.oProcess.icCommandline = 'tsr-tu3A.exe'
> ThisForm.oProcess.icLaunchDir = "C:\TsrTu3a"
> ThisForm.oProcess.icWindowMode = "NOR"
>
>and getting a NULL response = "Can't do it". I have stepped it through to the CrPr statement, then...
>

I assume that you then invoke LaunchAppAndWait().

Did you look at the icErrorMessage property after receiving the NULL back?

This is a SWAG, but if this is a DOS TSR, then it returns and leaves a stub running in the VDM, but the VDM shuts down at that point, so it won't do what you want. I'd try launching it with LaunchApp() and then polling the termination code with CheckProcessExitCode() to see what's happening if icErrorMessage doesn't give a description of the error.

Until you invoke one of the two LaunchApp methods, the app doesn't actually run; the NULL state for the hProcess indicates that no successful invocation took place. If it launched and failed to invoke, some value should return through icErrorMessage (at least that's how I wrote it...)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform