I have a VB6 class that needs to implement an interface which I created in C#. I have been able to succesfully implement all of the properties of the interface in my vb6 class over COM, but have not been able to implement the event that it has. If I understand correctly, I will need to have the equivilant of the add and remove accessors defined to regester consumers of the event, but I cannot get VB6 to accept the interface with the event defined. I am setting the InterfaceType of the class to InterfaceIsIDispatch, but still get the error "Bad interface for Implements: method has underscore in name" when I try to compile. The interface does not define any methods, and neither the properties nor the event have any underscores.

October 3rd, 2011, 02:03 PM

DataMiser

Re: Implementing a c# interface that has an event through COM

As a general rule you should nto use underscores in var, property nor function names. I know VB6 does it but MS says not to in the .net languages and code in general.

Edit: I think maybe I missunderstood the post, after reading again sounds like you are saying it is a bogus message about underscores?