 <p>If your program is a GUI then it is a good idea to run the serial port code in a separate worker thread. ReadFile can take a long time to get serial data and this would block the GUI message processing if it was done in the main thread. To provide notification events from the serial thread to the main (GUI) thread you can use PostMessage with a user-defined message. An example of doing this is at<br> <a href="http://vcfaq.mvps.org/mfc/12.htm" rel="nofollow">http://vcfaq.mvps.org/mfc/12.htm</a></p>