New VS feature allows VS to crash!

One of the newer “features” in Visual Studio 8.0 is the ability for us to collect better information about exceptions that are thrown in VS.  When an exception is thrown (and unhandled), VS will generate a Watson report that will send microsoft a minidump where the exception occurred.  Once we get this watson report, its…

3

Fixing Window leaks and "Class Already Registered" errors

Windows Forms makes it very easy to create a rich UI experience.  But it also makes it easy to leak windows or resources. For example, say you create a new temporary AppDomain and decide to show some UI in it.  If you close the AppDomain without cleaning up the windows (ie call Dispose on the…

2

SpyWindowFinalizer and Windows Message Hooking

One very powerful API that some UI developers may not be aware of is SetWindowHookEx.  This api allows you to intercept all types of window messages before (or after) they are processed. You can use this to do a whole range of neat things.  For instance, you can log all messages in your app.  You…

0

Control.Invoke hangs under heavy stress

There have been reports of Control.Invoke hanging after the method completes.  This was reported by a few customers and we have fixed this.  For your reference: ID: SRX050308605416 KB Article: 896665 The problem stems from some of the errors I describe in my previous post.  IsCompleted will be “true”, but the AsyncWaitHandle will never be set.  The fix will…

3

Is this code threadsafe?

Here is a question for you multithreaded coders out there. After executing Thread1 and Thread2, what are the possible values for “i”?         bool b1 = false;        bool b2 = false;        int i = 0;         private void Thread1() {            b1 = true;            if (b2) {                i = 1;            }        }         private void Thread2()…

1