473,508 Members | 2,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to expose vb.net events to Vb6?

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
1 5793
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2600
by: MP | last post by:
Hello, I am trying to write a class that will expose some properties. One of the property is extracted from a SQL database and can be NULL or some integer value. Is there a elegant way of...
0
1436
by: Nadav | last post by:
Hi, Introduction: **************** I have a collection of COM objects that support a constant interface, the interface is build of a collection of properties, methods and events ( events are...
3
1699
by: Vera | last post by:
I built a class in VB.NET that has an overloaded constructor. It can either accept nothing, a string or an object Public Sub New( MyBase.New( End Su Public Sub New(ByVal strName As String...
2
1216
by: OxyGen | last post by:
can i create an .Net Library wich expose events to all the aplications connected to it?
6
4882
by: cipher | last post by:
I have some constant values in my web service that my client application will require. Having to keep server side and client side definitions insync is tedious. I am trying to do something like...
3
6294
by: Miguel Ferreira via .NET 247 | last post by:
Hi ! I have developed a class Library with several classes and methods. Its working fine with a windows forms test application, but now i need to create a webservice that will expose those...
14
5402
by: Jamey Shuemaker | last post by:
Greetings all, I've been reading for the last couple hours posts on this site and various MS sites about reference libraries and class modules. System: Windows 2K running an A2K db with...
0
1733
by: John Smith | last post by:
What's the magical incantation to be able to expose an enum to COM? namespace NThingy { // I want to be able to access this like an old school midl enum public enum FileStatusCodes { HOLD =...
1
2917
by: Sylvie | last post by:
I have an Aspx page (Name:"PG") (Contains "UC") and an Ascx Usercontrol (Name:"UC") (Contains "AspxGrid1") I wanna expose Aspxgrid1.rowchanged event to Aspx Page, when user vhanges or...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.