×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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

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

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

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

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 SCREEN = OFF 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 CLEAR EVENTS 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

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

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

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

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:

Quote (Mike Lewis)

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

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

I have raised this myself a while back.

thread184-1806921: VFP App still shows in Taskmgr after quitting... and the .exe is still held open so can't be updated

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 Smileing

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

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

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close