Cannot close application in or outside of debugger
-
I finally gave up and created a new project. Copied the controls and code from the offending form to the new project one block at a time, looking for the cause. It never materialized. New project works fine. I may never know what caused it. I'm going to just let this one go. Thanks for trying. This one was just too weird to keep chasing. :)
If Barney Frank eats a fruitcake, is it cannibalism?
Well done. Trying to understand and fix is excellent, stepping over it when normal measures don't work is quite acceptable. :thumbsup:
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
I finally gave up and created a new project. Copied the controls and code from the offending form to the new project one block at a time, looking for the cause. It never materialized. New project works fine. I may never know what caused it. I'm going to just let this one go. Thanks for trying. This one was just too weird to keep chasing. :)
If Barney Frank eats a fruitcake, is it cannibalism?
You may want to use WinMerge to compare the differences between your old and new project. Who knows, maybe something will stick out.
[
S<T>::f(U) // Out of line.
](http://msdn.microsoft.com/en-us/library/8yk3t00s(v=vs.71).aspx)
-
Oakman wrote:
Your own idea of recreating the form and adding control by control and code block by code block is one I have used successfully.
Yep, I'm about to get into that very thing. I can't find one thing wrong with the existing form and I'm wondering if the file is corrupt down in some level I cannot access.
If Barney Frank eats a fruitcake, is it cannibalism?
Using C# in Visual Studio 2005 I have had this problem using databound controls. If the user enters a value in a databound textbox that expects a value, then deletes the value, the program will not allow the user to leave the textbox, even to exit the program. You cannot do anything except re-enter a value. Dennis
-
I have a single-thread project that's been working fine until tonight. Everything goes well until I try to close it. No error msg, it doesn't freeze. But it won't close. In VS I have to hit the Stop Debugging button. If I run it from a shortcut, I have to use Task Manager to close it (and I get a Not Responding msg). The only changes I've made tonight was to add a tab control, one page with a WebBrowser and one with a ScintillaNet control. The ScintillaNet control was already in use and I simply moved it to a tabpage. I undid all this but the problem still exists. Closed and restarted VS and that didn't help. Commented out everything in the FormClosing sub - no effect. Other projects close without issue. Suggestions?
If Barney Frank eats a fruitcake, is it cannibalism?
Your UI thread isn't checking and processing windows messages. That's why you still have a window, CPU usage for the process is >0%, it won't exit, and you get a not-responding when you send a window close message to it with task manager (aka "use Task Manager to close it"). Might be worthwhile to configure VS to use the MS symbol server, then break the process. Find the UI thread (might be called "MainThread") and look at it's stack to see where its stuck. With any luck, the culprit will be obvious, but probably not since that thread is polling something and it probably looping in code that isn't yours. Good luck.
patbob
-
Open Task Manager and watch CPU load. Either your app is in an eternal loop (total CPU load = 100% divided by number of cores), or it is deadlocked (two threads waiting for a resource/lock the other is holding). BTW: are you absolutely sure your app is single-threaded? that requires you don't use any callbacks, no timers, no asynchronous operations, no ... :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
Luc Pattyn wrote:
eternal loop
- so much more poetic than infinite loop!
-
Luc Pattyn wrote:
eternal loop
- so much more poetic than infinite loop!
Poetry in motion. :-D
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
Tried
Application.Exit()
but it didn't change anything. I'm usingFormClosing
, but notFormClosed
. Only one eventhandler forFormClosing
. I gotta get off of here for tonight. Early start / long day tomorrow. I'll work on it again tomorrow. As always, thanks for your help. :)If Barney Frank eats a fruitcake, is it cannibalism?
-
GamleKoder wrote:
Barney Frank is one of the few decent, intelligent people we have in congress.
Risible at best. Let's face it - it was Barney Frank who swore up and down that Fanny and Freddy were solid even while Bush was warning that they needed to be more closely regulated. Barney Frank is a typical big spending, lying, agenda-driven liberal, and he bears a large part of the blame, via the Fanny and Freddy mess, for the bigger mess we're in now. Say what you will, but facts are facts. Barney is the poster boy for the brainless left.
If Barney Frank eats a fruitcake, is it cannibalism?
-
You may want to use WinMerge to compare the differences between your old and new project. Who knows, maybe something will stick out.
[
S<T>::f(U) // Out of line.
](http://msdn.microsoft.com/en-us/library/8yk3t00s(v=vs.71).aspx)
I was just going to point out that using a SCM would have helped diff'ing this as well. Or rolling back to last known good state... Andreas
-
I have a single-thread project that's been working fine until tonight. Everything goes well until I try to close it. No error msg, it doesn't freeze. But it won't close. In VS I have to hit the Stop Debugging button. If I run it from a shortcut, I have to use Task Manager to close it (and I get a Not Responding msg). The only changes I've made tonight was to add a tab control, one page with a WebBrowser and one with a ScintillaNet control. The ScintillaNet control was already in use and I simply moved it to a tabpage. I undid all this but the problem still exists. Closed and restarted VS and that didn't help. Commented out everything in the FormClosing sub - no effect. Other projects close without issue. Suggestions?
If Barney Frank eats a fruitcake, is it cannibalism?
Had a similar situation in C# and solved it with: Environment.Exit ();