Solved

Application.Exit - is not killing all the thread.

Posted on 2010-09-09
9
354 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
  • 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 85

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
 

Author Comment

by:chokka
ID: 33642200
Application is calling the Reports
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 85

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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now