By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,556 Members | 1,633 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,556 IT Pros & Developers. It's quick & easy.

How to expose vb.net events to Vb6?

P: n/a
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
Feb 7 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Mark the class and its methods as comvisible.

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
----------------
"Frank Rizzo" <fr****@notn.com> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...
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

Feb 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.