|
-
Jan 11th, 2007, 07:17 AM
#1
Thread Starter
New Member
[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.
-
Jan 12th, 2007, 01:24 AM
#2
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.
-
Jan 12th, 2007, 03:08 AM
#3
Thread Starter
New Member
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...
-
Jan 12th, 2007, 09:03 PM
#4
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|