
When you add a new event to your UserControl, you will just need to be sure to add it to the appropriate interface, as well. The C# templates linked below also automatically create these interfaces for you. This has been corrected in the updated C# templates by including in C# the extra attributes and interfaces required to make the events visible - interfaces which the VB compiler automatically creates for you in IL. I had written the original templates with the assumption that the two compilers would write similar IL - because of this faulty assumption, the events thrown in a C# UserControl were never received in VB6. To be specific, the VB compiler creates additional code in IL to make a VB class’s events and properties visible in VB6, while the C# compiler does not.

The differences between the VB and C# templates highlight the fact that although the two languages are often believed to do the same thing once code is compiled to IL, this is not really the case, and in fact, when it comes to COM, VB does a much better job. The feedback from the VB Team, along with some help from Mike Dooney, led me along the right path to rework my C# templates a bit (the toolkit comes with only VB.NET templates).


Even sweeter, however, was the nod I received from the Microsoft VB Team here: and here. The prize, an XBox 360 Elite system, was pretty sweet. I originally wrote the prize-winning Interop Forms article below for code project.
