Question

I need to add serial port (e.g. COM8) communications to my MFC application. Which APIs should I be looking at to do this? I need it to be able to wait for n bytes to be in the receive queue before triggering (event, message, callback, etc.). Is there a relatively simple way to do this? All the examples I have looked at appear to use a polling mechanism for receive. This will not work for my application. There needs to be some sort of triggering mechanism that is triggered when there are n bytes in the queue. Thanks.

Was it helpful?

Solution

Overlapped I/O in Win32 works really well: http://www.codeproject.com/KB/system/serial_com.aspx

Also AFAIK, there are no official MFC class(es) for serial communications. (These could be easily wrapped though).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top