M
Mike S.
Hello Everyone,
I have a class that I wrote in Visual Basic .NET (using version
1.0 of the Framework). It exposes one public event. I would like to be
able to declare an instance of the class in a Visual Basic 6.0 project
using the standard "WithEvents" syntax. In the .NET project, I set the
"Register for COM Interop" option in
Project->Properties->Configuration->Build and I wrapped the event
declaration in a public interface definition, and I also set the
ComSourceInterfaces attribute to use the interface. I can reference
the .NET library in VB 6.0 and the event shows up in the Object
Browser, but instantiating the class with WithEvents seems to have no
effect. Here is a stripped-down snippet of the .NET code to show how I
declared and set the COM source interface (note that the vertical
ellipses represent omitted code):
..
..
..
Imports System.Runtime.InteropServices
Public Interface IFtpClientEvents
Sub ClientError(ByVal ErrorString As String)
End Interface
<ComSourceInterfaces(GetType(IFtpClientEvents))> _
Public Class FtpClient
..
..
..
End Class
If anyone needs a more detailed description, let me know.
I have a class that I wrote in Visual Basic .NET (using version
1.0 of the Framework). It exposes one public event. I would like to be
able to declare an instance of the class in a Visual Basic 6.0 project
using the standard "WithEvents" syntax. In the .NET project, I set the
"Register for COM Interop" option in
Project->Properties->Configuration->Build and I wrapped the event
declaration in a public interface definition, and I also set the
ComSourceInterfaces attribute to use the interface. I can reference
the .NET library in VB 6.0 and the event shows up in the Object
Browser, but instantiating the class with WithEvents seems to have no
effect. Here is a stripped-down snippet of the .NET code to show how I
declared and set the COM source interface (note that the vertical
ellipses represent omitted code):
..
..
..
Imports System.Runtime.InteropServices
Public Interface IFtpClientEvents
Sub ClientError(ByVal ErrorString As String)
End Interface
<ComSourceInterfaces(GetType(IFtpClientEvents))> _
Public Class FtpClient
..
..
..
End Class
If anyone needs a more detailed description, let me know.