Sam Gentile's Radio Weblog : Partying with .NET

 

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

.NET COM Interop Flawed Part 3 - A Solution

.NET COM Interop Flaw Discussion Part 3


We (the people I work with) have managed to solve the huge .NET Interop flaws that I have detailed in 2 seperate outings here. As I detailed, COM Interop in .NET is fundamentally flawed as the PIAs (RCWs) do not determinisically clean up all the COM Interface pointers and this is a showstopper problem in non-trivial COM applocations. So our .NET code has become peppered with Marshal.ReleaseComObject calls and even UCOMxxx calls. I have detailed why this is wrong before.

We have come up with a solution. In a nutshell, we implement intelligent wrappers that implement IDisposable and the Dispose Pattern, and have the wrapper call ReleaseComObject and such. This is something Microsoft should have done automatically in generated Interops and frankly we can't understand why. The nature of their response has been something along the lines of having to use Late Binding to not break COM Versioning? Excuse me? There is no COM Versioning and if Microsoft is inventing it now, it breaks the rules of COM. When I need a new "version" of a COM interface, I make a ILoveCOM2 interface. That's the extent of COM versioning. Period. We think COM Interop is broken without this.




© Copyright 2002 Sam Gentile.
Last update: 7/1/2002; 9:38:48 PM.

Click here to visit the Radio UserLand website.