CCW's and Duplicate Names
I had a short project during the Christmas/New Year's break. I had to create some CCW's (COM Callable Wrappers) for a client that wanted to replace some existing COM objects with new .NET objects. The requirement was that the existing COM clients (built with early-binding) would not need recompiling. They have a product that allows their customers to write their own extensions. So requiring hundreds of clients to recompile all of their extensions was something they wanted to avoid.
I started with the usual COM-interop procedures -- define an interface, use attributes for your GUIDs and DISPids, events, etc... But then I ran into a problem. One of their COM objects that I was replacing had both a method and an event with the same name. Since they were a VB.NET shop I was doing all of this work in VB.NET. Regardless of the language, .NET doesn't let you create a method and an event with the same name.
I had an idea. While C# gives you two ways to implement an interface -- either explicit or implicit -- VB.NET only gives you one (which matches C#'s implicit implementation). I wrote a quick test using explicit implementation of an interface method along with an event with the same name as the method. C# was fine with that and as far as interop goes, the CCW didn't care. It could find both the method and the event without any problems.
So I checked with the client and they were okay with using C# for the CCW's. I moved my current code to C# and completed the wrappers. So if you ever need to do some COM interop and run into an event and method with the same name, look into a C# wrapper with explicit interface implementation.