Jim Fell
Jim Fell

Reputation: 14256

MFC Serial Communications

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.

Upvotes: 1

Views: 5391

Answers (1)

Erwin Alva
Erwin Alva

Reputation: 393

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).

Upvotes: 2

Related Questions