How to expose vb.net events to Vb6?

F

Frank Rizzo

Hello, how can I expose events in a vb.net class to a vb6 client?

'Here is the vb.net code
<GuidAttribute("1b08d99b-cb12-420e-bb47-4ec73795bd9c")> _
<ClassInterface(ClassInterfaceType.AutoDual)> _
public Class DotNetClass
Public Event GenericEvent(ByVal EventName As String)

public sub new()
end sub

public sub test()
RaiseEvent GenericEvent("test")
end sub
end class


'Here is the vb6 code
private withevents oDotNet as DotNetClass

I get an error here saying that 'Object does not source automation events'

What am I missing here?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top