B
Bob Day
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
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