Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PROCESS.VCX (API_APPRUN)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00225698
Message ID:
00225755
Vues:
30
>Ed,
>
>The "Close on exit" did the trick. There wasn't a Program tab in the Properties of the zip.exe file so I assume that you were talking about a PIF file. In my Foxrun.PIF file I had the "Close on exit" checked but since process.vcx wasn't using Foxrun that PIF wasn't getting used. I created a zip.PIF and am now, once again, a happy camper.
>
>Thanks very much for the class and thanks for the help in using it.
>

No problem - sorry I didn't make the relationship between the PIF and the DOS executable clearer. It's about time I got around to releasing a new version which uses my CLSHEAP stuff to make more of the CreateProcess() API call easily accessible, and this time, I'll try to do more than just comment the code...

>Ed
>
>>>Ed,
>>>
>>>I recently downloaded your process.vcx class. I have a freeware zip.exe which is a DOS executable that I want to run without the DOS window popping up.
>>>
>>>In VFP6.0 SP3 I can run the program with the line
>>>RUN zip.exe -@ atest.zip < atest.txt
>>>
>>>The systax is zip
>>>In this case the -@ means to take the source from stdin and, using the DOS piping symbol, the stdin is a text file with a list of the files to be zipped.
>>>
>>>I created a small prg to test out the process class.
>>>
>>>Since I could not get it to run I finally backed off to the simplest executable statement which is "zip -h" which should just popup the help text.
>>>
>>>All text, program, and class files are in the current directory.
>>>The program as I have it at present is:
>>>
>>>SET CLASSLIB TO process
>>>oProcess = CREATEOBJ('API_APPRUN','zip.exe -h',,'NOR')
>>>oProcess.LaunchApp()
>>>? oProcess.KillProc()
>>>oProcess = ''
>>>
>>>Nothing happens. In some configurations ('zip.exe atest.zip atest.dbf' for example) I get a DOS window that just waits for keyboard entry. In other configurations I get a Fatal Exception Error)
>>>
>>
>>You don't have the executable set to Close on Exit - go into Explorer, right click the executable, select Properties, and in the Program Tab, chheck the box marked Close on Entry. The DOS box will shut down on its own, then.
>>
>>You should be getting a logical value returned from LaunchApp(); if it comes back other than .t., examine the property icErrorMessage to see what is going wrong.
>>
>>Once you have the program closing the DOS window for you, try using LaunchAppAndWait(), which doesn't return to VFP until program termination.
>>
>>Killproc should not be called to terminate the application unless it hangs - it results in a messy death by a call to TerminateProcess(), whcih can leave Windows in an unstable state.
>>
>>>Can you tell from my sample code what I might be doing wrong?
>>>
>>>Ed
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform