Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exe still running after quit command in procedure of exit menu bar

Status
Not open for further replies.

rkdua66

Programmer
Jul 25, 2013
8
IN
On selection of exit menu bar, quit command executed. When tried to overwrite exe, message being displayed "file access is denied myapp.exe".
Kindly help us to resolve the issue.
Thanks
Ravinder
 
Ravinder,

As an urgent solution, press Ctrl, Shift & Esc keys together. You can press Ctrl, keep it pressed, then press Shift, now keep both these pressed and finally press the Esc key. When you get the Task Manager window, release the keys.

Now, in Task Manager, if you don't see 'Processes' tag at left top, look at bottom left corner. You will see 'More Details'. Click on that.

Click on 'Processes'. You will see a list of running processes. Click on 'Names' at top. The list will be sorted on process names. Scroll to find your application name. Right click on it. You will get a small window with options. Click 'End Task' on it. Your application will be released.

Now, you must be able to overwrite the file.

By the way, you will have to find why the application was not released even after executing QUIT command.
Is the entry point into your application, ie the first code that gets executed, a PRG or a FORM?

Please come with more details. There are many well experienced people who can help you.

Rajesh
 
Well, the first thing to do is to check the Windows Task Manager to see if the app is indeed still running. (Look for it in the Processes tab, not the Applications tab.)

If it is running, and if you are sure it is not visible on the screen, that will either be because at some point you have set _SCREEN.Visible to .F., or because you have [tt]SCREEN = OFF[/tt] in your Config file. Both are quite normal.

In that case, the QUIT command has clearly failed to complete. There can be several reasons for that. (A modal dialogue is active; a [tt]CLEAR EVENTS[/tt] is missing; a QueryUnload fails; etc.) The best thing is to make _SCREEN visible so that you can see any errors or other messages that might be generated. If that doesn't help, try tracing the relevant code in the Debugger.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
There is rarely, if ever, a reason to use the QUIT command in an application. If your application's main program is properly structured, then after you choose Exit on the menu, you issue CLEAR EVENTS (and maybe do other stuff) and then the remainder of the main program (everything that follows READ EVENTS) executes and when it finishes, the EXE ends.

That said, removing QUIT isn't likely to fix your problem. But it's unnecessary.

Tamar
 
First, perhaps: It's a misunderstanding that QUIT exits the VFP process immediately.
When you issue Quit, all Destroay methods of objects are triggered, and all QueryUnload Events of forms.

That's what you need to know to understand Mike's comment:
Mike Lewis said:
the QUIT command has clearly failed to complete.
It can in fact fail to complete, and in such a case the process still is running.

Chriss
 
I have raised this myself a while back.

thread184-1806921

I have a very similar situation, a number of apps running on a server, which sometimes QUIT as requested, but leave the exe
in a position where you cannot do much with it - because the process has not actually stopped - it is visible as a background
process in TaskMgr and only terminating that releases the .exe

With regard to never needing to QUIT, I have a number of scanners that need to be completely reloaded after a period - because of memory leaks
and the like, so I let them run for 1000 iterations (for example) then load them again and QUIT the original. This enables me to keep
them running sometimes for months on end. I also use the same trick to update the original .exe with a new one when required.



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
Looking back at some of my recent apps, I see that, for the most part, I don't use QUIT. I just let the main program run off the end, as per Tamar's suggestion.

I once had a lot of trouble from issuing a QUIT in my error-handler. I saw that, even after the QUIT, the program was still active, with forms, menus, etc. all still visible. I eventually traced it to a NODEFULT in one of the form's QueryUnload. That prevented the form from closing (probably because of unsaved edits), which in turn prevented the application from closing.

I removed the QUIT from the error-handler and instead called the Windows ExitProcess() function, after rolling back all the transactions and reverting all the buffers. That solved the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top