-
VS串口程序
这是VS实现串口通信的详细代码和资料。里面有各类实现的方法。串口通信(Serial Communications)的概念非常简单,串口按位(bit)发送和接收字节。尽管比按字节(byte)的并行通信慢,但是串口可以在使用一根线发送数据的同时用另一根线接收数据。它很简单并且能够实现远距离通信。比如IEEE488定义并行通行状态时,规定设备线总长不得超过20米,并且任意两个设备间的长度不得超过2米;而对于串口而言,长度可达1200米。典型地,串口用于ASCII码字符的传输。通信使用3根线完成,分别是地线、发送、接收。由于串口通信是异步的,端口能够在一根线上发送数据同时在另一根线上接收数据。其他线用于握手,但不是必须的。串口通信最重要的参数是波特率、数据位、停止位和奇偶校验。对于两个进行通信的端口,这些参数必须匹配。
- 2022-02-05 19:15:08下载
- 积分:1
-
The preparation of a pathway to solve the maze procedure. (2) the user to enter...
编制一个求解迷宫通路的程序。(2) 用户以文件的形式输入迷宫的数据:文件中迷宫保存在一个[ ]中,e表示入口,x表示出口,1表示障碍,0表示通路,每一行用逗号隔开。-The preparation of a pathway to solve the maze procedure. (2) the user to enter the maze in the form of data: documents saved in a maze [] in, e express entrance, x express export, express one obstacle, 0 express pathway, each line separated by commas.
- 2022-05-26 17:28:38下载
- 积分:1
-
数据结构与算法
数据结构与算法-程序、素材二叉链表类测试-Data Structures and Algorithms- procedures, materials list Binary Class Testing
- 2023-01-07 21:35:03下载
- 积分:1
-
Software Quality is linked to the majority of programmers in mind in the mouth r...
软件质量是被大多数程序员挂在嘴上而不是放在心上的东西!
除了完全外行和真正的编程高手外,初读本书,你最先的感受将是惊慌:“哇!我以
前捏造的C++/C 程序怎么会有那么多的毛病?”
别难过,作者只不过比你早几年、多几次惊慌而已。
请花一两个小时认真阅读这本百页经书,你将会获益匪浅,这是前面N-1 个读者的
建议。-Software Quality is linked to the majority of programmers in mind in the mouth rather than things! In addition to full and genuine programming lay outside experts, read the book early, you will be the first to feel the panic: " wow! I used to fabricate the C++/C process how there were so many problems?" Do not be sad, the author only A few years ago than you, more than just a few panic-stricken. Please take 12 hours to read through 100 of this book, you will be benefited, which is N-1 in front of the recommendations of readers.
- 2022-06-13 13:23:33下载
- 积分:1
-
将不同格式的数据转换成cstring格式,很方便,文件存在txt文件中...
将不同格式的数据转换成cstring格式,很方便,文件存在txt文件中-different data format conversion cstring format, is a convenient, the paper documents exist txt
- 2023-03-18 14:20:04下载
- 积分:1
-
一个只能输入Float类型数据的CEdit扩展类.
一个只能输入Float类型数据的CEdit扩展类.-Float one can only enter the expansion of the type of data type CEdit.
- 2022-02-21 14:47:30下载
- 积分:1
-
改变鼠标形状的小程序。运行程序后,让鼠标停留在窗口的不同位置上,可以显示出不同的形状。...
改变鼠标形状的小程序。运行程序后,让鼠标停留在窗口的不同位置上,可以显示出不同的形状。-change the shape of the mouse small programs. Operational procedures, so that the mouse to stay in the window on different locations can demonstrate different shapes.
- 2022-07-13 01:05:56下载
- 积分:1
-
一个时钟的程序,带指针的哪种,主要是对画法的了解
一个时钟的程序,带指针的哪种,主要是对画法的了解-A clock procedures, with indicators of which, mainly for drawing understanding
- 2022-02-26 22:21:06下载
- 积分:1
-
文件修改监控
ReadDirectoryChangesW 有同步和异步2种方式,
根据前面打开的文件夹对象句柄决定。
1. 异步方式,如果 CreateFile 指定了打开类型 FILE_FLAG_OVERLAPPED 就是异步方式,ReadDirectoryChangesW 调用的时候就需要指定 OVERLAPPED 参数.
接下来对文件夹I/O变化的响应判断有多种方式。
A通过不断的调用HasOverlappedIoCompleted函数(非阻塞,参数就是前面的OVERLAPPED 对象指针)的返回值来判断是否发生了 关注文件句柄的I/O操作。如果发生变化,再执行你的 switch(Buffer[0].Action) 操作过程。
B GetOverlappedResult 读取 OVERLAPPED 对象的结果。(阻塞)
C 完成端口 GetQueuedCompletionStatus (阻塞)。
其中阻塞方式,必须采用多线程的方式,否则你的主线程被阻塞的话,对话框就动不了了。非阻塞方式也可用多线程,结合hEvent对象来使用。
2.同步方式,如果CreateFile不指定FILE_FLAG_OVERLAPPED ,就是同步方式。
同步方式操作比较简单。lz的程序看来就是使用的同步方式。
在同步下,ReadDirectoryChangesW 将被阻塞,直到一个文件夹句柄的I/O操作到来,然后才能判断。所以lz的程序会死掉。
同步方式必须采用多线程,再创建一个线程,线程函数采用如下方式:
UINT ThreadProc(PVOID)
{
CreateFile();
while(1) // 如果只想监视一次文件的I/O变化,可不用while循环。
{
- 2022-03-10 05:44:52下载
- 积分:1
-
clipboard enhancement procedures
剪贴板增强程序 -clipboard enhancement procedures
- 2022-03-19 14:04:53下载
- 积分:1