Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP5 app. won't close automatically when W95 shuts down.
Message
From
03/07/1998 08:01:54
 
 
To
01/07/1998 22:44:04
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00113290
Message ID:
00114040
Views:
29
>>>I have a small application that generally runs in the background. When I close Windows 95, the error message "cannot close Visual Fox Pro" comes up. I have to manually exit the program and then shut down. Is there a way to allow a VFP5 program to close automatically with Windows 95? I can't find anything in the documentation.
>>
>>David
>>
>>You need a program that runs ON SHUTDOWN DO
>>
>>This program should at least CLEAR EVENTS and perform any other tidying. It should also clear the ON SHUTDOWN program.
>>
>>HTH
>
>Thanks Ian, I hadn't noticed the ON SHUTDOWN command. I tried using it, in accordance with the online documentation, which said close tables, release forms and quit, and it hangs my system! Do you have an example of an ON SHUTDOWN procedure or program that has worked? I can't see what I'm doing wrong.
>
>David

I've noticed some problems in VFP where if certain DLL declarations are in effect, the QUIT command is unreliable. Early in your program, make the following declaration:
DECLARE INTEGER ExitProcess IN Win32API ;
	INTEGER ExitCode
Add the following line to fire the API call from ShutDown:

ON SHUTDOWN =ExitProcess(0)

Note: ExitProcess is CASE SENSITIVE in both its declaration and in referencing it.

hth
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