Ed,
I saw your solution to the problem of running dos programs in
VFP6 and making sure that the dos program is finished before
VFP continues on the Universal Thread. I downloaded the
PROCESS.vcx class and included it in my project. Let me first
state that I am new to working with VFP and classes. My app
has to run batch programs that FTP files from one sever to
another. Here is the code that I am using with your class:
Set classlib to process additive
oapprun=createobj('api_apprun','c:\dataflow\barbatch.bat','c:\dataflow',"min")
oapprun.launchappandwait()
do while .t.
if oapprun.CheckProcessExitCode()=259
loop
else
exit
endif
enddo
release oapprun
I saw in a message that I can poll the CheckProcessExitCode
for a value other than 259 to make sure it has ended before
proceeding with the rest of the program. This code is inside
of a timer that is set to false by the time it gets to this
code. My problem is that I have to insert a wait window with
a timeout of 5 seconds after this code. If I take the wait window
out, the timer code is started all over again for some reason.
Do you see anything wrong with this sample code or is there
a better way to check for the termination of the program?
I really appreciate any direction that you may lend me!!
Joe Glen
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement