Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Launching a DOS program from VFP 5
Message
De
10/12/1998 12:26:00
 
 
À
10/12/1998 10:18:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00166060
Message ID:
00166187
Vues:
21
>I am helping someone using VFP 5.0 with NT 4.0 and need to download some data from a BBS using ProComm. The present method is to RUN procomm.exe and wait for the data to download.
>
>Would he be better off to use the Windows API ShellExecute and if so
>why? I am not up to speed on using APIs so an example would certainly be helpful. My concern with the present method is that
>Procomm will go off and do its thing on a seperate NT thread and
>control will be returned to VFP too soon for this application.
>

You would be better off using CreateProcess(), since it returns a usable process handle; you can use it to monitor program termination and retreive an error code if one is given at termination. I posted a class in the FAQ last week that makes it usable. You can also easily control the initial window mode for DOS and WinApps launched via CreateProcess(), so that no DOS window need appear if you don't want it to. There are methods in the class that will either launch the app and return control immediately, or launch the app and wait on the program to terminate before returning control to VFP. Since it uses a process handle to minitor status, you don't have to worry about FindWindow(), and can check termination status without knwing the window (or if you launch it hidden, without any window at all being present on the system.

I've used this to run a DOS credit card clear app for one of my clients; it works quite well.

>Anyone done this type of thing before?
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform