[VB.NET 2003] Thread and CallBack
Hi,
I use callkack function for webcam capture (VideoStream).
A class contains all work for one camera. When callback function is raised, then class raises an event.
I want to use 2 cameras, so 2 classes instances. The 2 cameras use the same device (Microsoft WDM Image Capture).
The fact is that my first callback stops when the 2nd one is initialized.
I could understand this but I'm able to run twice my Exe and both work fine...
so I think I could have 2 threads and 2 callback in the same Exe, but... I don't find how.
Any idea?
Thanks.
Re: [VB.NET 2003] Thread and CallBack
Huh? You should show some code. It sounds like you are overwriting your first handler with the second one instead of adding another handler. Look up the help on AddHandler.
Re: [VB.NET 2003] Thread and CallBack
Thanks for your answer.
I 've just solved my problem. I have made cleaner threads...
Is there a nice way to maintain a thread running?
I use
Do
Application.DoEvents
Loop Until Condition
But I not very proud of it...
Re: [VB.NET 2003] Thread and CallBack
Why would you keep a thread running? The way you are doing it will consume a lot of resources. It would be much more efficent if you used a timer although it really depends on what you are using the thread for. What are you using the thread for?