Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nocturnal print via MUTEX and Run-App-and-Wait
Message
From
19/08/1999 20:19:09
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00254699
Message ID:
00255638
Views:
21
>Ed and George,
>I know this is got to be simple but I can't get those nightly reports automated
>
>
>...You want to make sure that you're using my API_APPRUN class ...download it ..., and then start up an instance of Quest using launchApp - which runs the program and immediately returns control to VFP. You can periodically check the progress of the application using the object's CheckProcessExitCode() method; if returns a value other than 259, the other instance is done.
>
>Paste Edgar's code here:
>DO WHILE .NOT. EOF()
>. nCNTER= nCNTER+1
>. cCmdLineOut= Alltrim(REPORTS)
>. oQuest=CREATEOBJECT('API_APPRUN',cCmdLineOut, "C:\Gupta\", "HIDE")
>. =LaunchAppAndWait(cCmdLineOut, "C:\Gupta\","HIDE")
>. Do While .T.
>.. Wait Window NoWait "Running Quest Report Number "+ str(nCNTER)
>.. IF oQuest.CheckProcessExitCode() != 259 && 259=ProcessRunning
>... RELEASE oQuest
>... EXIT
>.. ENDIF
>. EndDo
>. SKIP
>ENDDO
>
>This code miserably fails (loop forever)
>also if I do not loop while the first Quest is active
>then an GPF occurs because two Quest are requested?!?
>
>What's next? (Thanx for help)

Is Quest a DOS App? If so, you need to set the program to Close on Exit (go into Windows Explorer, right-click the executable, select Properties, select the Program Tab and make certian that Close On Exit is checked.
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