473,320 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Events Sample that I can then use in VB with With Evnets keyword


I have a DotNet C++ class that I would like to fire an event to then be
used by VB.Net using the With Events keyword. I have experience
creating connection point events for ActiveX controls, it is actually
very easy with the ATL wizard but I am lost when it comes to C++ .Net's
events.
Can anyone please point me to an example in VC++ .Net that allows me to
then use the component in VB with the With Events keyword?
Bruce
Dec 23 '06 #1
7 1448
I have a DotNet C++ class that I would like to fire an event to then be
used by VB.Net using the With Events keyword. I have experience creating
connection point events for ActiveX controls, it is actually very easy
with the ATL wizard but I am lost when it comes to C++ .Net's events.
Can anyone please point me to an example in VC++ .Net that allows me to
then use the component in VB with the With Events keyword?
Hi,
do a search on www.codeproject.com. you will find lots of examples.
that site is always my starting point when i need samples.

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Dec 23 '06 #2
Bruno van Dooren [MVP VC++] wrote:
>I have a DotNet C++ class that I would like to fire an event to then be
used by VB.Net using the With Events keyword. I have experience creating
connection point events for ActiveX controls, it is actually very easy
with the ATL wizard but I am lost when it comes to C++ .Net's events.
Can anyone please point me to an example in VC++ .Net that allows me to
then use the component in VB with the With Events keyword?

Hi,
do a search on www.codeproject.com. you will find lots of examples.
that site is always my starting point when i need samples.
Thanks Bruno. Code Project is a wonderful website but I have yet to
find an example that has a really good sample of events.

After some searching, I would this one:

http://groups.google.com/group/micro...1a58507e01e84e

But it does not show how to use the class with, With Event keyword in VB.

Also the delegate is declared outside the class that is the source of
the event. Is this normal?
Bruce
Dec 23 '06 #3
Hi,
Thanks Bruno. Code Project is a wonderful website but I have yet to find
an example that has a really good sample of events.

After some searching, I would this one:

http://groups.google.com/group/micro...1a58507e01e84e

But it does not show how to use the class with, With Event keyword in VB.
For that you could ask in the vb group. I wouldn't know how to do something
specific in VB.

For testing this part of your problem, you could create a C# class that
exports an event.
That would probably easier for you to find info about.

For using a .NET event in a specific way, it does not matter which language
the assembly was created with.
Also the delegate is declared outside the class that is the source of the
event. Is this normal?
This should not be a problem. It could be a generic delegate that is used in
lots of classes
Btw, that sample is for MC++, which is a deprecated syntax.
C++/CLI is the definite way for using .NET in C++.
do a search for C++/CLI event, and you should get some positive hits.

these 2 things should be a lot easier to figure out separately.
Once you know them both you can then combine them.
Hope this helps.

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Dec 23 '06 #4
Bruno van Dooren [MVP VC++] wrote:
Hi,
>
For that you could ask in the vb group. I wouldn't know how to do something
specific in VB.

For testing this part of your problem, you could create a C# class that
exports an event.
That would probably easier for you to find info about.

For using a .NET event in a specific way, it does not matter which language
the assembly was created with.
This should not be a problem. It could be a generic delegate that is used in
lots of classes
Btw, that sample is for MC++, which is a deprecated syntax.
C++/CLI is the definite way for using .NET in C++.
do a search for C++/CLI event, and you should get some positive hits.

these 2 things should be a lot easier to figure out separately.
Once you know them both you can then combine them.
Hope this helps.
Thanks again Bruno,

I am still using VC7. (Too cheap to upgrade to VC8, though I do have
the Express Version). Does C++/CLI events work for VC7?

I am still searching for some sample code.

Bruce
Dec 23 '06 #5
Bruno van Dooren [MVP VC++] wrote:
Hi,
>But it does not show how to use the class with, With Event keyword in VB.

For that you could ask in the vb group. I wouldn't know how to do something
specific in VB.

For testing this part of your problem, you could create a C# class that
exports an event.
That would probably easier for you to find info about.

For using a .NET event in a specific way, it does not matter which language
the assembly was created with.
>
This should not be a problem. It could be a generic delegate that is used in
lots of classes
Btw, that sample is for MC++, which is a deprecated syntax.
C++/CLI is the definite way for using .NET in C++.
do a search for C++/CLI event, and you should get some positive hits.

these 2 things should be a lot easier to figure out separately.
Once you know them both you can then combine them.
Hope this helps.

P.S. I must use C++ because I am building a managed wrapper for an
existing C++ unmanaged library.
Dec 23 '06 #6

"Bruce" <Br***@nospam.comwrote in message
news:O1**************@TK2MSFTNGP02.phx.gbl...
Bruno van Dooren [MVP VC++] wrote:
>Hi,
>>
For that you could ask in the vb group. I wouldn't know how to do
something specific in VB.

For testing this part of your problem, you could create a C# class that
exports an event.
That would probably easier for you to find info about.

For using a .NET event in a specific way, it does not matter which
language the assembly was created with.
This should not be a problem. It could be a generic delegate that is used
in lots of classes
Btw, that sample is for MC++, which is a deprecated syntax.
C++/CLI is the definite way for using .NET in C++.
do a search for C++/CLI event, and you should get some positive hits.

these 2 things should be a lot easier to figure out separately.
Once you know them both you can then combine them.
Hope this helps.

Thanks again Bruno,

I am still using VC7. (Too cheap to upgrade to VC8, though I do have the
Express Version). Does C++/CLI events work for VC7?
VC8 Express beats VC7 any version for almost any purpose.
>
I am still searching for some sample code.

Bruce


Dec 26 '06 #7
Bruce wrote:
Does C++/CLI events work for VC7?
The C++/CLI language was introduced in VC8. VC7 requires you to use the
old MC++ syntax, not the new C++/CLI one.

Tom
Dec 29 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
8
by: JPRoot | last post by:
Hi M. Jeffrey Tan, Just hopping you didn't forget me? :) Thanks JPRoot ----- \"Jeffrey Tan\" wrote: -----
6
by: Flare | last post by:
Hi i have a qusstion about events and delegates. Especially the precis role of the Event. Eg. We have a class wich want to fire events so we declare: public delegate void...
7
by: Rakesh Rajan | last post by:
Hi, I find that when i define a delegate, it gets derived from MulticastDelegate, which provides all funtionality that events would provide (like registering new handlers etc.). Then, apart from...
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
11
by: John Salerno | last post by:
My general problem with events seems to be that there are so many parts to them, and I'm not sure where they all go or when you use which parts. For example, there's the delegate, the event name,...
30
by: Burkhard | last post by:
Hi, I am new to C# (with long year experience in C++) and I am a bit confused by the language construct of events. What is it I can do with events that I cannot do with delegates? At the moment...
6
by: Smithers | last post by:
Just looking to compile a list of "all the ways to implement events". I'm NOT looking to get into the merits or mechanics of each in this thread... just want to identify them all - good, bad, and...
7
by: Siegfried Heintze | last post by:
I'm studying the book "Microsoft Visual Basic.NET Language Reference" and I would like some clarify the difference between events and delegates. On page 156 I see a WinForms example of timer that...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.