views:

200

answers:

2

Whenever I'm at a break point in a certain C#.NET application in Visual Studio 2008 and I fire up Microsoft Word 2007, word will fail to open until I restart the C# application. I have a few theories about why, but does anyone know for sure?

+2  A: 

A common cause of such hangs is (or used to be) an application that sent a broadcast Windows message on startup and expected a response from every window. If you've got a GUI application open in a debugger, then it won't be replying to Windows messages and so the sending application will hang waiting for a response. I recall the most common types of programs that used this technique were installer programs.

I don't know whether Word 2007 sends any broadcast messages, but that's only one way this might happen. There are a myriad ways that COM/OLE stuff can get hung up, and this probably seems more likely for Word.

Greg Hewgill
+4  A: 

This can be because Word is sending out DDE messages to top level windows, and your app is not able to process it since it is hung in the debugger. Raymond Chen has a blog post on this (though not directly related to debugger, but same effect).

Rob Walker