473,769 Members | 6,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Raise Events vs Timmers recognizing thread instantiations.

Using VS 2003, Vb, MSDE...

Option 1 -------------------------------------------
Thread A and B are instantiations of 2 different classes. If thread A
raises an event caught by thread B, the delagate in thread B that executes
is 1) running under thread A based on the debug threading window and 2) does
not seem to be aware of any instantiations of thread B in its declarations
section. See **** for what fails.

Class B (which is thread B)
Instantiate Voice as new Class_Com_Objec t

sub Delagate_For_Ra ised_Event_From _Thread_ClassA
voice.xxx ***** this line fails with voice = nothing.
end sub

End Class B

Is this the correct way delagates work? Is there a way around this? This
would seem to limit their useability dramatically. I expected the delagate
to be run as if thread it was within was running it (even showing the thread
it was withing tobe the thread running it).

Option 2 -------------------------------------------
Thread B has a timer in its thread/class that executes the
Delagate_For_Ra ised_Event_From _Thread_ClassA above every 10 seconds. This
time, the timer is 1) running under a seperate thread based on the debug
threading window (like the RaiseEvent in option 1), but 2) it DOES seem to
be aware of all instantiations of that thread B in its declarations section.

Is this the correct way timers work? It would seem so, which would make it
a better solution for what I am trying to do.

Thanks!
Bob Day
Nov 20 '05 #1
2 2068
Cor
Hi Bob,

There are a lot of answers in the original thread of your question.

Is it not better to give your comments or ask further questions there?

This method gives you less and less answers in a newsgroup, because people
does not want to type it every time over and over again and search what was
there previous answer.

Cor


Option 1 -------------------------------------------
Thread A and B are instantiations of 2 different classes. If thread A
raises an event caught by thread B, the delagate in thread B that executes
is 1) running under thread A based on the debug threading window and 2) does not seem to be aware of any instantiations of thread B in its declarations
section. See **** for what fails.

Class B (which is thread B)
Instantiate Voice as new Class_Com_Objec t

sub Delagate_For_Ra ised_Event_From _Thread_ClassA
voice.xxx ***** this line fails with voice = nothing.
end sub

End Class B

Is this the correct way delagates work? Is there a way around this? This
would seem to limit their useability dramatically. I expected the delagate to be run as if thread it was within was running it (even showing the thread it was withing tobe the thread running it).

Option 2 -------------------------------------------
Thread B has a timer in its thread/class that executes the
Delagate_For_Ra ised_Event_From _Thread_ClassA above every 10 seconds. This
time, the timer is 1) running under a seperate thread based on the debug
threading window (like the RaiseEvent in option 1), but 2) it DOES seem to
be aware of all instantiations of that thread B in its declarations section.
Is this the correct way timers work? It would seem so, which would make it a better solution for what I am trying to do.

Thanks!
Bob Day

Nov 20 '05 #2
Hi Bob,

We have posted a reply to the issue below.

Subject: Thread A notifying Thread B of an Event
Newsgroups: microsoft.publi c.dotnet.langua ges.vb

You may go and take a look to see if that will help you.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #3

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

Similar topics

1
10522
by: Dan Cimpoiesu | last post by:
I have a remoting object, derived from MarshalByRefComponent, that I instantiate on the client side, with Activator.GetObject. Can I receive events fired on the server, on the client? How?
2
1917
by: Andrew | last post by:
Hi, friends, I need to raise certain events in my VC# windows control library. Any reference paper or sample source code for help? Thanks a lot...
5
3223
by: Waleed AlRashoud | last post by:
Hi, I hope u can help me I asked this question before but I didn't explain it very well. Let say I hvae a thread 'A', creates object 'O', and start thread 'B' to do some work on 'O', OK? I want thread 'B' to fire event of 'O' BUT MUST THAT EVENT DONE BY THREAD 'A' not 'B'!!
1
1599
by: zorhel | last post by:
Hi. How can I raise an event in a specific client, or in all clients, not using thread, in a web application using asp.net? The .net remoting works in this case? How? I can't understand yet! Someone have any example? Thanks in advance. Zorhel
2
1603
by: IcedCrow | last post by:
Subject says it all. I want to raise an event in Sub New of a class but it is not being raised to my client app. I can raise events just fine in other procedures... just not sub new. Why is this? Thanks in advance!
4
9813
by: Charles Law | last post by:
Suppose a worker thread needs to signal to the main thread that an event has occurred. Ordinarily, any event raised by the worker thread will be on its own thread. How can the worker thread raise an event on the main thread instead? TIA Charles
2
2081
by: Pietro | last post by:
Hello, somebody know how to raise an event from a nested class? I have two classes, the class1 with 1 events, and a nested class (class2) inside the class1. So... How can I raise class1 events from the class2? Public Class class1 Public Shared Event Evento1(ByRef sender As Object) Public Class class2
2
9153
by: Sin Jeong-hun | last post by:
Suppose class Engine do something in another thread and raise events. class Engine { Thread Worker; public event ... EngineMessage; public void Start() { Worker=new Thread(new ThreadStart(Run)); Worker.Start();
11
4032
by: nadeem_far | last post by:
Hello, I am working on a c# project using framework 1.1. Since its a console application,no windows forms are being used. I am trying to implement event driven classes that just want to raise the event and continue working( like fire and forget - do not wait for the event handler in client to finish.) I have gone through alot of the articles on internet and MSDN and most talk about delegates (or BackGroundWorker in 2.0 which I cannot
0
9587
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9993
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6672
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
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 we have to send another system
3
2815
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.