Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

Application.Exit - is not killing all the thread.


VS 2005 / VB.Net

Application.Exit - is not killing all the thread which is invoked by Main Application.

How to kill all the threads, when we execute the application.
0
chokka
Asked:
chokka
  • 3
  • 2
  • 2
  • +2
1 Solution
 
packratt_jkCommented:
Either do a Thread.Join(threadobject), or else set the thread's IsBackground property to true (before you start it).
0
 
chokkaAuthor Commented:
Can i get complete syntax ?
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
"Application.Exit - is not killing all the thread which is invoked by Main Application."

Can you show us how you are creating the threads?...
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
chokkaAuthor Commented:
Application is calling the Reports
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Can you show us how are opening these reports then?...
0
 
vivekpv10Commented:
try defining the thread you are creating  as a Background worker,
when you define the thread. like this...
thread t = new thread(new threadstart(function));
t.IsBackground = true;
t.Start();
0
 
paultantonyCommented:
Try to close all threads using ExitThread and then use the Application.Exit
0
 
paultantonyCommented:
You may also use System.Environment.Exit or end statement but both are ungraceful way of ending the program. you should close all the threads and forms and end gracefully. you may also try Environment.Exit(0)
0
 
chokkaAuthor Commented:

 Now i have replaced the code from Application.Exit to Environment.Exit(0)

I have to wait for the results from Testing Team
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now