Serial Confusion

P

Paul Cheetham

Hi,

I am developing an application in VB.Net, that listens on a COMM port
waiting for an event.
I spawn a new thread, and call the API function WaitCommEvent in order
to wait for the required event to occur.

This is all working great - until I want to end my application.

No matter what I do, I don't seem to be able to find a way to stop the
child thread from waiting for the next event. I have tried aborting the
thread, but it completely ignores me until something has happened at the
serial port. The main application begins to shut down, and then sits
there waiting for the child thread top terminate before it finally closes.

Does anybody have any idea what I can do about this, it's driving me mad!!

Thankyou.

Paul Cheetham
 
D

Dick Grier

Hi,

You can see how to do this by examining the serial code on
www.opennetcf.org. Or, you can simply use that object instead of your
own -- or download DesktopSerialIO from my homepage, which provides a
slightly different API. Both OpenNETCF and my serial objects are free.
There is more information in my book (see below).

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 
T

Terry Olsen

I've tried to find the serial port component at OpenNetCF.org, but I
can't seem to find it. Can you direct me? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top