Serial Confusion

  • Thread starter Thread starter Paul Cheetham
  • Start date Start date
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
 
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.
 
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.
 
Back
Top