private void form1_load(object sender,EventArgs e) { int i=o; while (i<10) { if (connection()==1) { read_delete(); sendsms(); closing();// } else { messagebox.show("Error Conecting to Device","shine",messageboxbuttons.ok,messagebox.icon.Error); Application.exit(); } i=0+1; //for infinite Loop } }
5 Replies - 3621 Views - Last Post: 08 August 2012 - 10:14 AM
Rate Topic:




#1
shine a u
application.exit() not working
Posted 08 August 2012 - 03:01 AM
Check This Code
Replies To: application.exit() not working
#2
RudiVisser
Re: application.exit() not working
Posted 08 August 2012 - 03:05 AM
Cool.
What's the problem and what have you tried?
What's the problem and what have you tried?
This post has been edited by RudiVisser: 08 August 2012 - 03:10 AM
#4
Vishu Sukhdev
Re: application.exit() not working
Posted 08 August 2012 - 06:07 AM
You get message "Error Conecting to Device".
I think you should place break point on if condition and debug all your coding to see its working fine.
I think you should place break point on if condition and debug all your coding to see its working fine.
#5
tlhIn`toq
Re: application.exit() not working
Posted 08 August 2012 - 07:14 AM
RudiVisser, on 08 August 2012 - 04:05 AM, said:
What's the problem and what have you tried?
shine a u, on 08 August 2012 - 04:14 AM, said:
I Am Trying To send and receive SMS through GSM/GPRS Modem.
What does that have to do with the title of your post: "application.exit()" not working?
Application.Exit() will work if it is ever reached. So it must be that it is not being reached.
You have an if condition that must be met, and even if it is you call three methods; any of which might break with an exception or just go into a loop and never return.
Vishu is right: You need to learn to debug.
shine a u: What this shows us is that you aren't familiar with breakpoints and how to debug your own code. Learning to debug one's own code is an essential skill. Sadly, one that apparently few college courses teach. Silly if you ask me.
Placing breakpoints and walking through the code line by line allows you to actually WATCH it execute.
Visualizing what your code does will let you see why it behaves the way it does.
It would be well worth your time to do the tutorials on FAQ 2. A couple hours learning this skill will save you hundreds of hours of confusion in one project alone.
See FAQ # 2. (Click the SHOW button below)
TOP most asked:
What does this error message mean?
FAQ 2: How do I debug
FAQ 3: How do I make Class1/Form1 talk to Class2/Form2
FAQ (Frequently Asked Questions - Updated July 2012
Spoiler
- My program is broken:
- Q: My program doesn't work. I didn't show you any code or actually tell you the error message. How do I fix it?
SpoilerA: What have you tried so far? It is a requirment of this site that you at least make an effort to research (read the MSDN) and code a good faith effort for your own problem. Can you share your current code with us and better explain what issues or errors you are getting?
Give us something to go on
- Q: I do x and y happens which I didn't expect but I don't know how to figure out why. How do I debug and find my problem?
A:Spoiler- Debugging video 1: Breakpoints and Local variables
- Debugging video 2: Advanced breakpoints
- Debugging tutorial
- Debugging tips
- Debugging in detail
- Great debugging tips
- It still doesn't work, article
- Debugging tools survival guide
- Video: Tips & Tricks to use Visual Studio to the fullest
- 5 return dataset.Tables[tableName].Columns.Count;
A condensed line like this makes a lot of assuptions that everything goes right, and gives you nothing to check or debug.
If only for R&D / Debug purposes it can often be advantagous to break down the line
if (dataset != null) { if (datase.Tables != null) { if (!string.IsNullOrWhiteSpace(tableName) { if (dataset.Tables[tableName].Columns != null)
Now you can put a breakpoint on the top line and walk through it with F10 and check every object. You also don't try to manipulate a thing that doesn't yet exist.
How do I?
- Debugging video 1: Breakpoints and Local variables
- Q: ...get Form 'A' to make a change or talk to Form 'B'
Spoiler
NOTE: Don't try to access GUI controls across forms. Its wrong. Nobody will hire you if you do this sort of crap. It violates every guideline for 'black box' programming, Separation of Responsibility, loose binding of components, and event driven programming. Read the tutorials and learn to do it right the first time so you don't develop bad habits that you just have to un-learn later.
A:- See this thread for the simplest of example code between two forms.
The tutorials below actually teach and explain it further. - Passing values between forms/classes
- Bulding an application - Part 1
- Building an application - Part 2
- Quick and easy custom events
- Delegates, Lambdas and Events
- http://www.codeproje...g-Windows-Forms
- See this thread for the simplest of example code between two forms.
- Q: ...make a binary to int calculator
A: Read my article
- Q: ...make a tabbed web browser?
A: Read this thread
- Q: ...make a password/login form?
A: Password handling tutorial
- Q: ... get all the sub-folders of a folder, and the sub-folders of those, to get all the levels of directories?
A: [/b/Its a technique known as recursion.
Spoiler
The GetDirectories() method will get all the directories in a folder, then call itself with those directories... which in turn get all the subfolders and calls itself with those folders... which get all the subfolders and calls itself with those folders... Recursively calling itself as it drills down.
It is demonstrated on the MSDN
http://support.microsoft.com/kb/303974
Found by Googling "MSDN Recursive Directory"
- Q: ... browse for/open a file?
Read this tutorial
- Q: ...make a chat or client-server application?
A:Client/server chat tutorial
Peer-to-peer chat
- Q: ... get my program to programmatically simulate a mouse click or button press?
A: Simulate mouse and keystroke (even to another application)
- Q: ... save data, save properties, save environmental variables, serialize my data/class?
A:Spoiler
- Q:... get sound in my program?
A: Adding sound to your C# application
- Q: ... use the serial port?
A: Serial port communication
- Q: ...do compression or .zip files?
A:- (de)Compression tutorial
- Zip files tutorial
- (de)Compression tutorial
- Q:...do multi-threading? Having a problem with cross-threading...
Spoiler
- Q: ... make my textbox offer suggestions as the user types. (Autocomplete)
A: Creating an auto-complete textbox
- Q: ... make a textbox just accept numbers and not letters?
A: Read this thread - Q:I get an error when I try to use a textbox for numeric values and the user types non-numbers. What do I do?
A:SpoilerWe see this a LOT, especially with rookies using textbox for numeric input.
Any input that can't be converted to a number will do this.
"5" can become 5
"yogi" cannot become a number
string.empty cannot become a number
You would be best off changing from a textbox to a NumericUpDown or to inherit from textbox to make a numerictextbox.
There are a LOT of articles on making a NumericTextBox. Try googling "C# NumericTextBox" and you should find a lot, such as this one on the MSDN:
http://msdn.microsof...4(v=vs.80).aspx
Once you study the code you'll see that as each key is pressed it is checked to see if it is a number. If not, then it is ignored. Thus the user can only enter numerically valid values.
- Q: ... use PInvoke and the Win32 api calls to get functions not available in .NET framework?
A: Using the Win32 API Tutorial
- Q: ... have both a WinForms Windows app, and still have a Console window open?
SpoilerA: Make your new project a WinForms project. Then go back to project properties (Right-click on the project, select Properties).
On the Application tab go to the dropdown that says "Windows Forms" and change it to "Console Application." You now have a WinForms application with a console window. I do this on occassion to see my Console.WriteLine statements when I am debugging. But don't consider this mixed mode operation a proper way to release an application for real-world use.
- Q: ... make a username/password logon (login) system?
A: Read this tutorial
- Q: ... make global hotkeys?
A: Global Hotkeys Tutorial
Can someone explain...
- Q: ...Why my multi-thread throws a cross-threading error when it tries to update my GUI?
A: Your thread shouldn't be trying to affect any GUI at all: Ever.
Spoiler
Quote
But when I kick off the background worker and it goes to change a label in this panel
I'll stop you right there. That underlying principal for your program is the problem and just won't work. The worker is a different thread than the one that created the GUI.
Background threads do not, ever, directly access anything that they didn't make. Period. Accept that and start re-designing.
Background worker raises events. You main class that makes this background worker has to subscribe to those events. Then that thread can update its GUI.
This is how is it meant to work. Each 'thing' in a program really should have only one purpose in life and cause no side affects. The background worker should do its job and nothing else. Its job is not to manage the GUI. The GUI thread's job is to manage the GUI.
Think of it this way: Your car dashboard has one job: To be the GUI for your car. But if the speedometer dies you don't want that to keep the engine from starting. The speedometer and the engine are 'loosely bound' for a reason. Your program is the same. You need the GUI to run whether or not the background worker does, and you want the background worker to run regardless which GUI you have on display.
So the background worker is kept ignorant of which panel you have up. It just says "I'm 50% done". If you have the simple panel or the complex panel on display doesn't matter. It hears the event and does whatever it is designed to do to display those results. Maybe the simple panel uses a progress bar, while the advanced panel display the exact percentage. The background thread doesn't know or care how it is shown.
Quote
So my main application should make a dozen threads to update the dozen similar controls?
To me that sounds like the main application is doing too much work and micromanaging the other controls. If the main application is coded for 12 background threads and panels, what happens in 6 months when you want to add a couple more panels? You have to update all your infrastructure to support them.
Personally I would make UserControls that consist of the Panel, its own backgroundworker and any pure objects that you might want to serialize for later restoration. The idea is to make a complete and fully self-contained 'Lego Block' of functionality. Then use your application to just hook them all together.
Now you can place 2 of your custom controls on screen... or 20... and they each take complete care of themselves. Only when one of your custom controls raises an event like LogThis(string message) or HighLevelWarning(int level) does the application have to do anything. The bulk of the work is done within the UserControl
In each of these UserControls I would create methods for Start() and Stop(). Let the UserControl handle its own needs.
Your main application should do nothing more than:
StartAllPanels() { foreach(CustomPanel cp in myPanelsCollection) { cp.Start(); // Tell the panel to start cp.WarningMessage += WarningHandlerMethod; // Subscribe to warning event cp.LogThis += LogMessageHandlerMethod; // Subscribe to logging event } }
See how your main application has no idea what the panel needs to do to start up? It doesn't try to micromanage the panel and tell it to start it's backgroundworker. The main app is blissfully ignorant of the inner needs of the component. Its like a the driver of a car. The driver doesn't tell the car: Close 12v power, start fuel pump, begin ignition computer, calibrate fuel/air mix, confirm foot is on brake, start ignition... The driver just turns the key to Start(). Your application should be the same. It only needs to know what it NEEDS to know. Let the rest of the parts take on as much responsibility as you can push on them.
Spending a little time on these tutorials before writing any more code should help you with a better understanding of all this and enable you to architect a better blueprint for your application. Work smarter not harder.
The tutorials below walk through making an application including inheritance, custom events and custom controls, object serialization and more.
Quick and easy custom events
Bulding an application - Part 1
Building an application - Part 2
Separating data from GUI - PLUS - serializing the data to XML
WPF version (WPF-MVVM data binding)
Passing values between forms/classes
Decouple your multi-threaded work from the GUI so forms don't hang
- Q: What are lambdas? What Is (Obj, E) => ?
A: Excellent article by Curtis Rutland
- Q: ... how to do x, y, z with the HTML that comes out of a website ...
A: Check out the HTML Agility Pack. Yes its free.
- Q:... how to do x,y,z with a database {probably for the first time}...
A: Read this tutorial
Entire section of tutorials
Parameterizing Your SQL Queries: The RIGHT Way To Query A Database.
Using SqlDependency to monitor SQL database changes
- Q: Can someone explain bitwise operations?
A: Terrific explanation by [email protected]. Be sure to +1 him for this thread.
I'm lost while learning xyz... I don't know where to begin...
- Q:I'm trying to teach myself programming. I'm writing a program to do xyz, rather than following a guided self teaching book or lesson plan or on-line tutorial because I just don't learn from books.
A:SpoilerI'm sorry for how this sounds. I tend to take the stance that I can do you more good and give you more long-term meaningful help by being frank and give you adult-level honesty. I don't feel it does anyone any good to coddle them and do nothing but blow sunshine and rainbows up their skirt. I'd rather say something
to motivate you than feel my place is to bolster your false high self esteem.
Quote
]
I've tried going through those, the only way im learning is through struggling to write code from scratch, the thought process i guess is helping me, i've tried reading sooo much and watching videos but honestly I'm not learning until I actaully type it.
I hear this a lot and the only thing I can think is students are buying the wrong books. Or they read the information and don't feel they need to actually work the lessons/exercises. This argument sounds like there are only two choices:
- Develop from scratch even though they haven't learned the language yet.
- Just read C# dictionaries.
Maybe this is from students buying the course textbook and reading it on their own, without the benefit of the teacher and their lesson plan and exercise assignments. When one mis-uses the materials, or only has 25% of the materials, of course they won't learn.
Here's a tip when selecting a book: If it is a dictionary of the language it is not a teaching book. Titles like "C# 4.0, The Complete Language" are not teaching books. If the title includes the words "Learn" or "Master" or "Teach" they might be teaching books. "Learn C# in 21 days", "Master C# in 2 hours a night", "Head First C#, A self-teaching guide" Then they are probably teaching books with a lesson plan and exercises to help you build up skills.
Obviously you didn't read the resources list I posted or get any one of the NUMEROUS self-teaching books.
Self-teaching books HAVE YOU TYPING CODE. They are NOT just reading as you describe.
C# is a language just like Russian or English. You cannot learn Italian by just reading an Italian dictionary.
Or even reading an English-to-Italian dictionary. You have to take lessons and do the learning exercises. Those lessons and exercises are developed by professionals to take place in a sequence proven to work, by taking the student from simple to complex concepts. You did not learn how to compose literary works in English by just reading a dictionary. You worked at lessons that taught you the syntactical use of verbs, nouns, additives and so on. You worked lessons that had you build simple things first like "Those are my apples. These are your pencils", and worked up from there.
So why are you trying to "just read" to learn C#? Or why are you insisting on trying to design and code a working program without first learning the language? It makes no sense! Its like saying you have to design and write a mystery novel as your introductory educational process to learn German. Its just a fraking ridiculous argument to try to take or defend.
There are numerous on-line learning series on the internet that have you learning and WRITING code, not just reading. We have them right here on DIC and they have been linked to you several times. There are many good guided self-teaching books, that once again are NOT just reading but teaching through proven methods of:
- Introduce new material
- Have student exercise with new material
Yet you insist that you don't need to go the route that has worked for the 3 generation of coders before you:
Representatives of which are here TELLING you that is the way to learn this science/skill/art.
Quote
would i be able to take out the private double[] months = new double[12];
and place it in a method instead of leaving it in a private field, why does it have to be in a private field as opposed to a method in just placing it in the main method?
Questions like this last one show just how badly you need to stop trying to write this program and just concentrate on learning the language through some sort of guided lesson plan. This question is filled with so much lack of understanding that it is hard to know where to start in an effort to answer it. To answer this someone would have to back up 5 chapters and help you get a grasp of certain introductory concepts. It's not right to ask that of people that have already devoted tens or hundreds of hours to develop the tutorials we have here. You shouldn't be asking them to repeat themselves because you feel you need special hand-holding or because you don't want to get the right books or because you don't want to actually work the exercises in the books or tutorials.
- Develop from scratch even though they haven't learned the language yet.
- Q: I'm making a maze generator/solver and...
A: http://www.codeproje...enerator-Solver
- Q: I am making a calculator as my school homework project and ...
A: Calculator tutorial
- Q: I've been struggling with this for days/weeks and I can't figure it out and my professor is worthless and can't teach. Can someone here explain it to me?
A:SpoilerIf you are struggling with how to do this you need to talk to your professor. Let him/her know you are struggling at this early stage in class. Make your professor do the job (s)he gets paid to do by either helping you or finding you a tutor or giving you more exercises from earlier in the book. You are paying for this education. Be an active part in not allowing the teacher to brush you off and let you slip through the cracks. If the other 50 people in class aren't struggling then don't blame the teacher. If the other 50 people are struggling then you all need to go to the professor's superior and tell him/her. If the prof is really incompetent then you don't need to help him keep his cushy 100,000/year job. If the prof isn't incompetent then you need to study harder or consider buying another book on programming. You aren't required to ONLY use the text book provided for the class.
"How do you resolve your issues" survey.
- Q: I am doing a dice game for a school homework and...
A:Drawing dice on the console
- Q:
Quote
Hi,I'm currently learning C# in class at the moment and I'm a little bit stuck on what this question means.[...]show me where I can get help,
A:SpoilerYour professor. That's where to start for a couple reasons:
1. They are getting paid to teach you. If they aren't teaching you this needs to come to their attention and that of their superiors.
2. You're the one paying them. Tens of thousands of dollars for your education. You need to learn to take every ounce of knowledge you can from these teachers and not sit passively back and try to learn it on the outside. If you were going to do that then you didn't need to take out all the student loans that are going to keep you in
debt for the next 15 years.
3. You need to let the teacher do their job. If you are struggling here you don't want to hide it. You need them to be aware of position so they can give you the time and attention you need. Otherwise you will be a little lost on chapter 1. A little more on 2. Way behind by chapter 3. You have to get a good foundation now if you are to gain anything in the later lessons.
- Q: I want to write a program that does x, y and z with features for A, B, and C. {Notice there is no question in this question}
A:SpoilerThat is a very good statement of intent. Go right ahead. You don't need to announce your intentions to us, nor get anyone's permission. After you have made an effort to your own code (in good faith as described in the Welcome DIC email you got when you joined) and the forum rules that I'm sure you read before posting, and you have a QUESTION about this project... Please post the QUESTION here in this same thread.
There is no need to start a new thread for this same topic.
- Q: I need to code to do x... Someone tell me the code for y...
A:SpoilerYour question is about to get bounced for begging for code anyway but...
So you're asking the volunteers here to write your code for you, to make it do everything in your wish list?
Please read the rules.
You seem to misunderstand what we do here. We help people learn to code. We help people with their projects. We help people better understand the errors and exceptions they are getting so they can fix their issues. We are not a free code writing service. If you have made an effort to code a specific feature, but are not getting the results you wanted then please post the relivant code for that feature along with the error messages or an explanation of what results you are seeing as compared to the results you were expecting, and we will try to guide you onto the right path.
Read this article!!!!!
Discussion topics:
- Q: What is the best programming language/OS? What programming language/OS should I learn?
A:SpoilerAll of them. And none of them. You might as well be asking "What is the best kind of vehicle?" Because the answer for both questions is "It depends on your needs and what personally suites you the best." C, C++, C#, Objective-C, Cocoa, F#, Visual Basic, Python, JAVA...
Are all good languages. They all have their pros and cons. They each have their strengths and weaknesses. Some have stronger footholds in some markets than others. Do you want to write for iPhone/iPad then you need Objective-C. Do you want to write for generic mobile phone use then you need JAVA. And so on. If you have no idea what area of programming you want to move to (Gaming, Financial, Windows, Macintosh, Cell phones) then nobody can advise you on a language. Personally, I would point you to C# because, like it or not, Microsoft owns the desktop computer market and C# will teach you good habits of design, OOP (Object Oriented Programming) design, inheritance and so on: Concepts that translate well to all other OOP languages.
The OS is a by-product of the type of coding you want to do, which in turn dictates the language you need, which then decides the operating system you probably need. Not the other way around.
Do you want to code apps for iOS devices like the iPad and iPhone? Then you need a Macintosh to do it right. Are you hankering to do machine vision programming? Industrial robot control? Financial applications?
What are your programming goals? Do you want to market $9.99 desktop applications to the masses? Do you want to make control systems for helicopters? XBox games requires the .NET XNA framework so you are now in Windows. Do you want to do embedded controls for automotive computers? Do you just love MS Office and love to make extensions for it? Do you want to work on web apps or desktop apps or mobile apps?
Do you now see why we can't even begin to tell you what is best for you? Only you know what you like and what you don't like. Only you know what area of programming is interesting to you. If you ask me for advice I might tell you video processing for the movie industry is great so you should get a Mac. Someone else is going to tell you cool stories of working on CSI lab equipment so you should do C embedded stuff.
The short answer for this question is: Get in touch with your own wants and needs then think for yourself.
Join these discussions on the topic:
Which coding language?
VB6 is dead
C# or C++?
- Q: How do I become a programmer?
A: Click the link
- Q: I'm not really sure what I want to do with my future? Do you guys like programming? I think I kinda like math and games and computers? What should I do or study?
A:Spoiler
You are asking a very vague, generalize question about a broad topic.
You might as well be asking... What is the best kind of vehicle to buy? Or what is the best kind of plastic to make? It all depends on your needs... Your area of business.
If you are interested in embedded devices like computers that control automobile engines it is still programming - but it is entirely different to writing a point of sale program meant to be used as a self-service kiosk like you see at Home Depot. And that is entirely different to writing a program that is meant to be used on a mobile platform.
You need to make a decision about what kind of programming, what area of interest, what industry you want to work in, before you can worry about the specifics of which language and OS and platform.
Which Language Should I Learn?
DIC Tutorials Section
Good thread on the topic
Get experience while you find yourself
- Q: What's your installation like? What sofware do you use? What are your Visual Studio extensions?
A:Spoiler
- Host Operating System - 16gig, quadcore, 3x24" Dell LCDs at 1920x1200 (2 landscape, 1 portrait)
- 20 times of on-line update/reboot cycle
- Device Drivers
- AVG antivirus
- VMware workstation
- VM Operating System
- 20 times of on-line update/reboot cycle
- Device Drivers
- Visual Studio
- ReSharper
- Dotfuscator
- CodeMaid
- XAML regions
- XAML code cleanup
- InstallShield
- ReSharper
- Expression blend studio
- MS Office
- SnagIt
- Safari
- iTunes
- Fences
- Yahoo messenger
- FoxIt PDF reader
- AnyDVD (I have DVDs from 3 different regions)
- TightVNC
- Dropbox
- AVG anti-virus
- Quicken
- Canon RAW codec
- Shark007 codec pack for Media Center
- Another 20 rounds of on-line update/reboot
- Take a snapshot of the VM machine for easy restoration
- 20 times of on-line update/reboot cycle
- 20 times of on-line update/reboot cycle
That is my entire install
Working for myself/Deploying/Selling software:
- Host Operating System - 16gig, quadcore, 3x24" Dell LCDs at 1920x1200 (2 landscape, 1 portrait)
- So you want to be a game programmer...
- Q:How do I stay a free lance coder for a living?
A:http://justcreatived...eelancing-life/
- Q: How do I become a better coder?
Read this, and practice a lot.
How to be a better coder
- Q: Are there any resources for small C# projects a novice to become a better coder?
A:SpoilerThere is a novice projects thread here on DIC. But here's my advice whenever this comes up:
Look around. Anyone who can't find a dozen projects a day by just walking through life, is doing so with their eyes closed to the world.
- Do you like the weather? What about a program to get the various weather reports from different web sites?
Or to integrate with one of the numerous USB weather station hobby kits on the market? - Do you like the run? What about a program to log your runs, routes and progress?
- Do you like movies? What about a program to catalog all your DVD's and AVI's?
- Do you like photography? What about a program to browse your images, assign tags and GPS?
- Do you like shooting? What about a program to track your aim and improvement?
- What about every time you walk into a business and someone says "Oh, I'm sorry. The computers are slow/suck.
This is going to take 10 minutes and 25 screens." Sounds like an opportunity to make and maybe even sell them a new program. So go home and make it first before you open your mouth. If you succeed in something great. If you fail, then you know where to study more and you haven't embarrassed yourself.
What about every time you walk into a business and someone says "Oh, I'm sorry. The computers are slow/suck. This is going to take 10 minutes and 25 screens." Sounds like an opportunity to make and maybe even sell them a new program. So go home and make it first before you open your mouth.
If you succeed in something great. If you fail, then you know where to study more and you haven't embarrassed yourself.
Go to any of the on-line coder for hire sites. Read the new contract descriptions. DON'T BID ON THEM. Just read them. This will tell you what is requested by employers so you know where you have the potential to make money, and tell you where you should study. Then pick a project and build it. TRACK YOUR TIME. If you don't know how
long it takes you to build a project then you won't be able to bid on contracts. If you bid $50 for 50 hours of work you're going to starve to death. Again, building projects just to learn the technology and learn your own speed and weaknesses is something we all do/did and you need to do too. Once you can build a project just for the learning experience, fast enough that you could have made a competitive bid... Now you can start considering actually bidding on new contracts that are in your skill set.
- Do you like the weather? What about a program to get the various weather reports from different web sites?
- Q: How do I sell the software I've developed?
A:http://www.dreaminco...m_notifications
- Q: How do I decide how much to charge for my application?
A: Read this
A lot of questions about freelancing were covered in the Q&A with the Experts thread
- Q: How do I deploy my program / Make an installer?
[b]A: C# application deployment project
Include the smallest .NET possible
#6
Skydiver
Re: application.exit() not working
Posted 08 August 2012 - 10:14 AM
What do you mean Application.Exit() doesn't work? What were you expecting it to do?
If you were expecting it to terminate you program right there and then, you are sadly mistaken. To quote from MSDN (emphasis mine):
In other words, .NET Framework Application.Exit() != C/C++ exit().
If you were expecting it to terminate you program right there and then, you are sadly mistaken. To quote from MSDN (emphasis mine):
Quote
The Exit method stops all running message loops on all threads and closes all windows of the application. This method does not necessarily force the application to exit. The Exit method is typically called from within a message loop, and forces Run to return.
In other words, .NET Framework Application.Exit() != C/C++ exit().
Page 1 of 1