Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Quit an Application
Message
From
11/01/2003 16:38:18
 
 
To
11/01/2003 15:57:08
John Tomblin
Service Station Systems, Inc.
San Jose, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00740696
Message ID:
00740704
Views:
26
John

Download the exitfox.exe sample from Microsoft Software Library. It might be here on the UT too but I cannot remember where I downloaded it. It describes the "Cannot Quit Visual FoxPro" error message which will be useful for you.

Have you got an ON SHUTDOWN program setup? Perhaps this is causing additional errors which, if so, would again call your ON ERROR handler in a loop unless you disable the error handler.

Also, you should check out the CLEAR EVENTS command which will clear any active READ EVENTS which is a common cause of VFP apps not exiting.

Lastly I found the following API function which will also exit your app - but be warned that using this will mean no nice cleanup (so not recommended)!

DECLARE ExitThread in Win32API
ExitThread()


>Like most applications, I begin with a prg that displays a splash screen, sets up the environment, opens the database, checks the user's permissions, and finally calls the menu.
>
>Before the database is opened, I issue the following command:
> on error do GiveUp
> open database MyData shared
>
> *------------------------------------------------
> procedure GiveUp
>
> =MessageBox("Helpful Hints ...")
> close all
> clear all
> quit
> cancel
> return
>
>All I want to do is to display a message and terminate.When the database cannot be opened, the messagebox does appear but, the application continues to run and produce error after error. Also, making this a function and returning .F. won't work either.
>
>Is it possible to force the termination of an application. If so. How?
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform