By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,591 Members | 1,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,591 IT Pros & Developers. It's quick & easy.

Raise Events vs Timmers recognizing thread instantiations.

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.