473,232 Members | 1,411 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,232 software developers and data experts.

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_Object

sub Delagate_For_Raised_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_Raised_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 2048
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_Object

sub Delagate_For_Raised_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_Raised_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.public.dotnet.languages.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
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
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
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...
1
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!...
2
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...
4
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...
2
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...
2
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...
11
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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...

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.