If you throw an exception from inside an MFC dialog, the app hangs, even if you have a catch block in your code. It refuses to respond to the mouse or keyboard, and the on
Mark's answer is correct. For a much more rigorous analysis of this problem and a detailed suggestion for dealing with it in your own code, see this FAQ by Doug Harrison (section Q6 in particular).
If you are interested in learning about how Windows detects apphangs we have added some posts to this on the Windows Error Reporting blog:
Let there be hangs part 1 of 4
Let there be hangs part 2 of 4
Let there be hangs part 3 of 4
Let there be hangs part 4 of 4
Important to note is that this information when sent through Microsoft's Windows Error Reporting gets communicated to the software developers to try and fix these issues. If you are sending in your error reports you WILL help fix issues that are occuring on your PC!
I am a Program Manager at Microsoft on the Windows Error Reporting team.
The code for CDialog::DoModal makes the dialog modal by disabling the parent window. When the dialog code returns, the window is reenabled. There is an explicit catch for CException* errors, but not for any other kind of thrown exception; thus the parent window never gets reenabled.
Change your code to throw a pointer to any exception derived from CException, and you'll fix the problem.