September 29th, 2011, 12:09 PM
Implementing a c# interface that has an event through COM
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
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?
Always use [code][/code] tags when posting code.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.