473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

App remains in processes

Hi

I have a winform app. When this app is closed it remains under 'Processes'
in Task Manager. What is the problem and how can I ensure that app closes
completely and releases all resources?

Thanks

Regards
Jul 22 '08 #1
14 1190
Use the "End" keyword.
--
David Streeter
Synchrotech Software
Sydney Australia
"John" wrote:
Hi

I have a winform app. When this app is closed it remains under 'Processes'
in Task Manager. What is the problem and how can I ensure that app closes
completely and releases all resources?

Thanks

Regards
Jul 22 '08 #2
Ken
On Tue, 22 Jul 2008 04:47:03 +0100, John wrote:
I have a winform app. When this app is closed it remains under
'Processes' in Task Manager. What is the problem and how can I ensure
that app closes completely and releases all resources?
I had that problem when I had a thread that monitored a port for incoming
data. I added 'Environment.Exit(0);' to Program.cs to close off any
threads.

Ken

Jul 22 '08 #3
Hi

I am closing the app by clicking the cross on the top right corner of the
main window. Where should I use End?

Thanks

Regards

"SurturZ" <su*****@newsgroup.nospamwrote in message
news:32**********************************@microsof t.com...
Use the "End" keyword.
--
David Streeter
Synchrotech Software
Sydney Australia
"John" wrote:
>Hi

I have a winform app. When this app is closed it remains under
'Processes'
in Task Manager. What is the problem and how can I ensure that app closes
completely and releases all resources?

Thanks

Regards

Jul 22 '08 #4
It's likely that your application is kept alive. Instead of forcing the
application to quit my personal preference would be likely to find out what
keeps the app aliave and to perform the appropriate cleanup... See what
could keep a reference to your app such as perhaps a callback to would be
kept by the system...

--
Patrice

"John" <in**@nospam.infovis.co.uka écrit dans le message de groupe de
discussion : #y*************@TK2MSFTNGP03.phx.gbl...
Hi

I have a winform app. When this app is closed it remains under 'Processes'
in Task Manager. What is the problem and how can I ensure that app closes
completely and releases all resources?

Thanks

Regards
Jul 22 '08 #5
Its just a winform app that runs a series of queries on an access backend
database. Can't think of anything special.

Thanks

Regards

"Patrice" <http://www.chez.com/scribe/wrote in message
news:uE**************@TK2MSFTNGP04.phx.gbl...
It's likely that your application is kept alive. Instead of forcing the
application to quit my personal preference would be likely to find out
what keeps the app aliave and to perform the appropriate cleanup... See
what could keep a reference to your app such as perhaps a callback to
would be kept by the system...

--
Patrice

"John" <in**@nospam.infovis.co.uka écrit dans le message de groupe de
discussion : #y*************@TK2MSFTNGP03.phx.gbl...
>Hi

I have a winform app. When this app is closed it remains under
'Processes' in Task Manager. What is the problem and how can I ensure
that app closes completely and releases all resources?

Thanks

Regards

Jul 22 '08 #6
John,

Never use End, it kills an application and you get unpredictable results,
that the taskmanager does not show direct the end of a program is a
behaviour of Windows OS.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:OP**************@TK2MSFTNGP03.phx.gbl...
Hi

I am closing the app by clicking the cross on the top right corner of the
main window. Where should I use End?

Thanks

Regards

"SurturZ" <su*****@newsgroup.nospamwrote in message
news:32**********************************@microsof t.com...
>Use the "End" keyword.
--
David Streeter
Synchrotech Software
Sydney Australia
"John" wrote:
>>Hi

I have a winform app. When this app is closed it remains under
'Processes'
in Task Manager. What is the problem and how can I ensure that app
closes
completely and releases all resources?

Thanks

Regards

Jul 22 '08 #7
Try attaching a debugger to it with the solution loaded and pausing the
application, on the 'Debug Location' toolbar, look at each of the threads in
turn and see if the code they are executing gives you any clues. It might be
on a blocking call to something.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"John" wrote:
Its just a winform app that runs a series of queries on an access backend
database. Can't think of anything special.

Thanks

Regards

"Patrice" <http://www.chez.com/scribe/wrote in message
news:uE**************@TK2MSFTNGP04.phx.gbl...
It's likely that your application is kept alive. Instead of forcing the
application to quit my personal preference would be likely to find out
what keeps the app aliave and to perform the appropriate cleanup... See
what could keep a reference to your app such as perhaps a callback to
would be kept by the system...

--
Patrice

"John" <in**@nospam.infovis.co.uka écrit dans le message de groupe de
discussion : #y*************@TK2MSFTNGP03.phx.gbl...
Hi

I have a winform app. When this app is closed it remains under
'Processes' in Task Manager. What is the problem and how can I ensure
that app closes completely and releases all resources?

Thanks

Regards


Jul 22 '08 #8
Try attaching a debugger to it with the solution loaded and pausing the
application, on the 'Debug Location' toolbar, look at each of the threads in
turn and see if the code they are executing gives you any clues. It might be
on a blocking call to something.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"John" wrote:
Its just a winform app that runs a series of queries on an access backend
database. Can't think of anything special.

Thanks

Regards

"Patrice" <http://www.chez.com/scribe/wrote in message
news:uE**************@TK2MSFTNGP04.phx.gbl...
It's likely that your application is kept alive. Instead of forcing the
application to quit my personal preference would be likely to find out
what keeps the app aliave and to perform the appropriate cleanup... See
what could keep a reference to your app such as perhaps a callback to
would be kept by the system...

--
Patrice

"John" <in**@nospam.infovis.co.uka écrit dans le message de groupe de
discussion : #y*************@TK2MSFTNGP03.phx.gbl...
Hi

I have a winform app. When this app is closed it remains under
'Processes' in Task Manager. What is the problem and how can I ensure
that app closes completely and releases all resources?

Thanks

Regards


Jul 22 '08 #9
On 2008-07-22, John <in**@nospam.infovis.co.ukwrote:
Its just a winform app that runs a series of queries on an access backend
database. Can't think of anything special.

Thanks

Regards
Are the queries run async or in a background thread?

--
Tom Shelton
Jul 22 '08 #10
I had the same problem in one of my programs. It also queries a SQL
database.
I found out since i did not close the connection, the program was still
running.

PetterL.
"Tom Shelton" <to*********@comcastXXXXXXX.netwrote in message
news:KP******************************@comcast.com. ..
On 2008-07-22, John <in**@nospam.infovis.co.ukwrote:
>Its just a winform app that runs a series of queries on an access backend
database. Can't think of anything special.

Thanks

Regards

Are the queries run async or in a background thread?

--
Tom Shelton

Jul 22 '08 #11
On Jul 22, 6:47 am, "John" <i...@nospam.infovis.co.ukwrote:
Hi

I have a winform app. When this app is closed it remains under 'Processes'
in Task Manager. What is the problem and how can I ensure that app closes
completely and releases all resources?

Thanks

Regards
Hi,
There may be several reasons, for example, if your application is
alive and uses notify control, you need to close it from notification
icon by assigning a contextmenu control by adding "me.close" to one of
its items. You can also make notfifyicon usable by putting code on
form's load:

NotifyIcon1.Icon = Me.Icon

Also, if your application contains some "hidden" forms which are
previously hidden though you think you've exited, your application is
supposed to be still alive as background process, and you need to
close hidden form with "close" method gently.

Additionaly, your application may remain alive if it interops with
other assemblies or processes during its lifetime depending on your
application's references.

Finally, make sure you're disposing all resources using with "Using"
statement if one of your application's classes use an IDisposable
object.

Hope this helps,

Onur Güzel
Jul 22 '08 #12
Queries run in the main thread/app in sequence, nothing special such as
threading in there.

Thanks

Regards

"Tom Shelton" <to*********@comcastXXXXXXX.netwrote in message
news:KP******************************@comcast.com. ..
On 2008-07-22, John <in**@nospam.infovis.co.ukwrote:
>Its just a winform app that runs a series of queries on an access backend
database. Can't think of anything special.

Thanks

Regards

Are the queries run async or in a background thread?

--
Tom Shelton

Jul 23 '08 #13
I have no threading in my app as well. But if you not close all connections
to the database before you close. The program will not end.complitly.

Here is what i put in my Form_close event
Me.STATIONTableAdapter.Connection.Close() 'close the adapter that has
the connection.to <SQL server
LoginForm2.Close() 'Closing the login form. This is a Custom login i
have made for my program.

"John" <in**@nospam.infovis.co.ukwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Queries run in the main thread/app in sequence, nothing special such as
threading in there.

Thanks

Regards

"Tom Shelton" <to*********@comcastXXXXXXX.netwrote in message
news:KP******************************@comcast.com. ..
>On 2008-07-22, John <in**@nospam.infovis.co.ukwrote:
>>Its just a winform app that runs a series of queries on an access
backend
database. Can't think of anything special.

Thanks

Regards

Are the queries run async or in a background thread?

--
Tom Shelton


Jul 23 '08 #14
Right you are, Application.Exit is better than End.

Microsoft continues its grand tradition of obliterating the usefulness of
any keyword that was part of ANSI BASIC, I see >:-{

(Besides DIM, GOTO, FOR-NEXT, and IF-THEN, are there any left??)

To John - put Application.Exit in the Form.FormClosed event of your main
form. You are better off if you clear out all global and module level
variables first. So if you have anything with a .Dispose method, call that
first. Setting all your global and module level variables to Nothing wouldn't
hurt either.

Ideally, you shouldn't need to use Application.Exit. If you dispose of all
your variables correctly, the application should just end when the main form
is closed.

--
David Streeter
Synchrotech Software
Sydney Australia
"Cor Ligthert[MVP]" wrote:
John,

Never use End, it kills an application and you get unpredictable results,
that the taskmanager does not show direct the end of a program is a
behaviour of Windows OS.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:OP**************@TK2MSFTNGP03.phx.gbl...
Hi

I am closing the app by clicking the cross on the top right corner of the
main window. Where should I use End?

Thanks

Regards

"SurturZ" <su*****@newsgroup.nospamwrote in message
news:32**********************************@microsof t.com...
Use the "End" keyword.
--
David Streeter
Synchrotech Software
Sydney Australia
"John" wrote:

Hi

I have a winform app. When this app is closed it remains under
'Processes'
in Task Manager. What is the problem and how can I ensure that app
closes
completely and releases all resources?

Thanks

Regards
Jul 24 '08 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Markus Franz | last post by:
Hi. I created a little script: for currenturl in sys.argv: pid = os.fork() if pid == 0: signal.alarm(10) do_something() # placeholder for the download and print routine
15
by: Dirk Reske | last post by:
Hello, why doesn't this code work correctly? private int GetCpuUsage(Process proc) { DateTime time1,time2; TimeSpan timediff; double cpu1,cpu2,cpudiff;
3
by: Vagabond Software | last post by:
Scenario: The end-user selects File-Save from my applications (WinForm) menu, specifies a filename, and waits waits for my app to write the contents of a dataset to an Excel workbook. The...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
11
by: Tim Marsden | last post by:
Hi, I have a routine which is call from a ASP.NET web form. This routine creates an excel application, opens a workbook , runs some code to update the workbook, saves it as HTML on the sever and...
4
by: AN | last post by:
Greetings, We make an ASP.NET web application and we host it for our customers. We have provisioned hardware and hope to be able to service around 200 customers on this hardware. The web...
0
by: HÃ¥kan Lundgren | last post by:
Hi! I have a Web-service calling a SQLServe2000 database. Everything works just fine, but when I look at Process Info in Enterprise Manager all processes from my Web Services remains with status...
35
by: Carl J. Van Arsdall | last post by:
Alright, based a on discussion on this mailing list, I've started to wonder, why use threads vs processes. So, If I have a system that has a large area of shared memory, which would be better? ...
1
by: jazon | last post by:
Let me start by saying this for an Operating Systems class. No, I don't expect the work to be done for me. The assignment is as follows: To be honest, I feel like a fish out of water, like...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.