473,326 Members | 2,095 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,326 software developers and data experts.

Raising events ????

Dear all,

I have a class wich is raising events as normally it
should do. having a form in the same assembly wich is
catching those events works fne. Raise events gets catch
normaly within the form and I can process what I want
based on them.

If I try to catch raised events by this class but within a
form located in a different assembly, I am not able to
catch them seems they are not raised or not coming until
the form eventhandler?

any idea why ?

my events are declared as follow in the assembly
Public Event AddCompleted()
Public Event DeleteCompleted()
Public Event UpdateCompleted()
Public Event Accepted()

regards
serge
Jul 21 '05 #1
4 2055
When you are making instances of the class, are you declaring it WithEvents?
"serge calderara" <se*************@maillefer.net> wrote in message
news:0e****************************@phx.gbl...
Dear all,

I have a class wich is raising events as normally it
should do. having a form in the same assembly wich is
catching those events works fne. Raise events gets catch
normaly within the form and I can process what I want
based on them.

If I try to catch raised events by this class but within a
form located in a different assembly, I am not able to
catch them seems they are not raised or not coming until
the form eventhandler?

any idea why ?

my events are declared as follow in the assembly
Public Event AddCompleted()
Public Event DeleteCompleted()
Public Event UpdateCompleted()
Public Event Accepted()

regards
serge

Jul 21 '05 #2
I find our the problem.
sipply declare my event as public shared and they are trigged from
anywhere

regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
Well yes, but that may be more than you need. Shared events (or any shared
members for that matter) do not require an instance of your class to be
used. So imagine being able to wire an event procedure on a class that is
not even instanced.

A good example of this would be the Show method of the MessageBox class.
You don't have to make an instance of a MessageBox to be able to use its
Show method.

If you've solved your problem, great! But you should be able to access
events of a class from a different assembly without having to resort to
this. If the class is declared "WithEvents" then it will receive
notifications about the events that are raised for the base class:

Public WithEvents Button1 As System.Windows.Forms.Button
"calderara serge" <se*************@maillefer.net> wrote in message
news:eA**************@TK2MSFTNGP12.phx.gbl...
I find our the problem.
sipply declare my event as public shared and they are trigged from
anywhere

regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #4
Because events get raised through the parent chain... if
your other form isn't in that chain... it will never see
the event get raised.... furthermore, if there is
processing that needs to happen at each level of parent,
you have a different set of issues... to make the event
visible beyond the first parent.......
-----Original Message-----
Dear all,

I have a class wich is raising events as normally it
should do. having a form in the same assembly wich is
catching those events works fne. Raise events gets catch
normaly within the form and I can process what I want
based on them.

If I try to catch raised events by this class but within aform located in a different assembly, I am not able to
catch them seems they are not raised or not coming until
the form eventhandler?

any idea why ?

my events are declared as follow in the assembly
Public Event AddCompleted()
Public Event DeleteCompleted()
Public Event UpdateCompleted()
Public Event Accepted()

regards
serge
.

Jul 21 '05 #5

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

Similar topics

6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
7
by: cider123 | last post by:
I'm coding a project using the following article as reference: http://www.codeproject.com/csharp/DynamicPluginManager.asp In this type of project, plugins are loaded dynamically into a Plugin...
0
by: Greg Park | last post by:
I have many user controls loading into a web page using Page.LoadControl However, I'm unable to figure out how to raise an event when a button is click or a check box is checked. I can have...
0
by: Joe Campbell | last post by:
I am encountering a problem raising WMI events from an asp.net application. The error received (as captured in the event log) is as follows: System.Runtime.InteropServices.COMException...
4
by: serge calderara | last post by:
Dear all, I have a class wich is raising events as normally it should do. having a form in the same assembly wich is catching those events works fne. Raise events gets catch normaly within the...
4
by: Dave A | last post by:
I am developing a somewhat complex component at the moment and coincidently I am also reading the Framework Design Guidelines book. After reading the section about event raising I have re-written...
2
by: Gman | last post by:
Hi, I have created a usercontrol, a grid control essentially. Within it I have a class: clsGridRecord. I have coded the events such that when a user clicks on the grid, say, the events occur on...
0
by: Apu Nahasapeemapetilon | last post by:
Suggestions on cross-posting this issue would be appreciated. I've got a C# .NET DLL (CLR v1.1) that raises events into its container. When the container is a .NET application, raising the...
7
by: Christian Cambier | last post by:
Hi, I have a textbox in a web user control. I then add the usercontrol to a web form. I also add a label in the web form. Now, when I press a key in the textbox, i want to display some text...
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
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...
1
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....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.