嗨,我有一個名爲CLSFW_SBSession與事件VB6的接口:擴展與事件VB6接口在C#
Public Event DataTransfer(ByVal Data As Variant)
Public Property Get ActionID() As Long
End Property
...
我需要將它與一個C#互操作類擴展。我試過:
[ComVisible(true)]
[Guid("ddb976bd-fe29-44d5-a163-e7780a4bb897")]
public class ClsSbSession : FWBO_LibSrv.CLSFW_SBSession
public event __CLSFW_SBSession_DataTransferEventHandler DataTransfer;
...
現在,如果我在VB6聲明此類型的對象,我實例它,不與事件,它的工作原理:
Private session As FWBO_LibSrv.CLSFW_SBSession
Set session = new ClsSbSession()
但是如果我使用:
Private WithEvents session As FWBO_LibSrv.CLSFW_SBSession
我嘗試實例吧:
Set session = new ClsSbSession()
我收到一個錯誤:
對象或類不支持的事件集
我如何可以管理從我的C#類的VB6事件做的?謝謝