How to flush serial buffers in VC++

C, C++, Visual C++, C++.Net Topics
Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to flush serial buffers in VC++

Post by Saman » Fri Dec 02, 2011 12:44 am

In Visual C++, we used to use CreateFile, ReadFile, WriteFile for serial communication just as files. At some points, it is required to flush the serial read/write buffers. You can use FlushFileBuffers(handle) function to do that. Note that handle is the handle returned by CreateFile function.
Post Reply

Return to “C/C++ Programming”