Visit our new web pagesWe have launched a new extended set of web pages at www.alvechurchdata.co.uk. These old pages will stay on the server because people still have links to them but they will not be updated. The new version of this page is at www.alvechurchdata.co.uk/hints-and-tips/foxcannotquit.html. |
||
Home About us Development Training Support |
Cannot quit Visual FoxProThe 'Cannot Quit Visual FoxPro' message must be one of the most common problems you meet when starting to work with Visual FoxPro.
It has been with us since the launch of Visual FoxPro but the problem still causes difficulties. The error message does not give an error number so you cannot find it in the Help system. Help returns nothing if you search for 'Cannot Quit Visual FoxPro' and MSDN is equally unhelpful. A search on Google though will show you that it's a very common question in all the support forums so it's disappointing that Microsoft have not added it to Help. Especially as it is a very simple problem to fix. Close the applicationThe first thing to do is to close the application that has locked. The least damaging way of doing this is to use the Windows Task Manager. In Windows 2000 and Windows XP you can open the Task Manager by pressing or by right-clicking on the Windows status bar. Select from the options that appear then click the on the Task Manager dialog:
Select your Visual FoxPro application from the list then click the button. You will be warned that this is an extreme act and asked to confirm that you do indeed want to cancel this process. Click and wait. Windows may take several seconds to complete the task of closing down the application. When it has been closed you will be told that you have terminated FoxPro prematurely and asked whether you want to report the problem to Microsoft. We have been reporting this for ten years now so I suspect it will be a waste of time to report it again.Now that you have cancelled the application, close the Task Manager and open your project in FoxPro. SolutionThe problem arises because Visual FoxPro is event-driven. The RunTime engine opens your executable and then responds to events as they occur. You have closed your application but not told FoxPro to stop waiting for events. The command to stop the event-processing loop is:
Clear Events
and FoxPro must execute this command whichever way that the application closes down. Depending on the structure of your application you might put the command is several places:
FoxPro executable flashes on screen and vanishesThe other problem you'll hit with the FoxPro event-processing loop is when you find that your executable won't run outside of the development environment. You just see a flash of your main form on screen before the executable closes. More details here . |
Hints & tips
The textbox class in Visual FoxPro 9 has a new Autocomplete
property which shows the user the previous values that have
been entered in that textbox.
More...
|