Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Application.Exit - is not killing all the thread.

Posted on 2010-09-09
9
Medium Priority
?
361 Views
Last Modified: 2012-05-10

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
Comment
Question by:chokka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 3

Expert Comment

by:packratt_jk
ID: 33641909
Either do a Thread.Join(threadobject), or else set the thread's IsBackground property to true (before you start it).
0
 

Author Comment

by:chokka
ID: 33642094
Can i get complete syntax ?
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 33642191
"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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:chokka
ID: 33642200
Application is calling the Reports
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 33642231
Can you show us how are opening these reports then?...
0
 
LVL 5

Expert Comment

by:vivekpv10
ID: 33643760
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
 
LVL 1

Expert Comment

by:paultantony
ID: 33643796
Try to close all threads using ExitThread and then use the Application.Exit
0
 
LVL 1

Accepted Solution

by:
paultantony earned 2000 total points
ID: 33643806
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
 

Author Comment

by:chokka
ID: 33760945

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

I have to wait for the results from Testing Team
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question