|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to expose vb.net events to Vb6?'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 Hi,
Mark the class and its methods as comvisible. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeinteropservicescomvisibleattributeclasstopic.asp Ken ---------------- Show quoteHide quote "Frank Rizzo" <fri***@notn.com> wrote in message news:OmMPmo7KGHA.1760@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
ADO.net + MS Access = performance issues
VB.NET Structures and Union Help. how to group similar events? 2nd Post: Problem adding events to controls created at run-time KeyUp + KeyDown Event Handler Calculate elapsed time Multiple threads using a shared printer resource Problems with ByRef parameters Copying files across network Help needed on creating Shared Directory |
|||||||||||||||||||||||