串口通信中,读取串口收到的数据前使用PurgeComm函数,我的问题是如果使用PurgeComm函数,不是把收到的数据缓冲区中的数据清空,不是收不到数据了?请各位高人指点
解决方案 »
- 请教vc中写一个资源管理器样式的程序,在listview和listview之间是如何互动的啊?
- WIN32多线程程序设计里面的一个关于程序耗时的问题
- CButtonST是否适合checkbox?
- GetTextExtentPoint求文本间距问题
- VC对EXCEL操作的问题
- VC如何关闭指定的IE
- 各位大侠!!急问如何SDI中(CFormView)中,打印Form上的控件(ListCtrl)中的内容。
- 定义常量问题?
- 请问斑竹各位高手 如何其他窗口切换为当前窗口
- vc6.0访问Web Server,联接成功,发送XML消息返回结果不正确
- 大家帮帮我。。vc,模式子对话框关闭时,主对话框也随之关闭,怎样才能不使它关闭,你们遇到过这种情况没?
- VC++ 加载tuxedo库的问题
HANDLE hFile, // handle to communications resource
DWORD dwFlags // action to perform
);
Parameters
hFile
Handle to the communications resource. The CreateFile function returns this handle.
dwFlags
Specifies the action to take. This parameter can be a combination of the following values: Value Meaning
PURGE_TXABORT Terminates all outstanding overlapped write operations and returns immediately, even if the write operations have not been completed.
PURGE_RXABORT Terminates all outstanding overlapped read operations and returns immediately, even if the read operations have not been completed.
PURGE_TXCLEAR Clears the output buffer (if the device driver has one).
PURGE_RXCLEAR Clears the input buffer (if the device driver has one).
Return Values
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError. Res
If a thread uses PurgeComm to flush an output buffer, the deleted characters are not transmitted. To empty the output buffer while ensuring that the contents are transmitted, call the FlushFileBuffers function (a synchronous operation). Note, however, that FlushFileBuffers is subject to flow control but not to write time-outs, and it will not return until all pending write operations have been transmitted.