C# to VB6 COM events (“object or class does not support the set of events”)

前端 未结 2 1366
北荒
北荒 2021-01-05 23:54

Really pulling my hair out with this one...

I have a C# project with an interface defined as:

/* Externally Accessible API */
[InterfaceType(ComInter         


        
2条回答
  •  孤街浪徒
    2021-01-05 23:59

    I was defining the interface using the delegate instead of the event:

    /* Externally Accesssible Event API */
    [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
    public interface ISerialEvent
    {
        [DispId(5)]
        void DataEvent();
    }
    

    should be

    /* Externally Accesssible Event API */
    [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
    public interface ISerialEvent
    {
        [DispId(5)]
        void dEvent();
    }
    

提交回复
热议问题