Un-threading my Threads!
- From: Paul Cheetham <PAC.News@xxxxxxxxxxxxx>
- Date: Thu, 15 Sep 2005 09:50:34 +0100
Hi,
I have a thread in my application that is listening to the Serial port using GetCommEvents.
When something is received, it generates an event, and then goes back to waiting for more data. - I am using this for a swipe card reader.
When a card is swiped, an event is generated, and I log the user into my application. The card reader is no longer required at this point so I disable it, which kills off the thread.
Now - because the card reader thread generated the event, my entire application seems to be using that thread, and so as soon as the thread gets killed, all my windows disappear, and the main thread is left running in the background with nothing to do.
I have tried creating a new thread in the event handler, so that when the first thread is stopped it would then keep running on the new one - but that one seems to get stopped as well with the same results, even though it is declared globally etc.
Can anybody tell me what I need to do to get around this problem, as I'm sure it's a fairly common problem, but I'm pretty new to multi-threading and it's giving me a headache!
Thankyou in advance.
Paul Cheetham .
- Follow-Ups:
- Re: Un-threading my Threads!
- From: Slow Learner
- Re: Un-threading my Threads!
- Prev by Date: Re: put in a asynchronous call with a callback
- Next by Date: Re: Un-threading my Threads!
- Previous by thread: Re: Method Parameters
- Next by thread: Re: Un-threading my Threads!
- Index(es):
Relevant Pages
|