术语 | setcommstate |
释义 | SetCommState 语法: C++ BOOL WINAPI SetCommState( __in HANDLE hFile, __in LPDCB lpDCB ); SetCommState函数 配置通讯设备按设备的规格,在控制块(1二氯苯结构)。函数重新初始化所有硬件和控制设置,但不空输出或输入队列。 参数 hFile [in] 一个句柄,通信设备。 CreateFile函数返回此句柄。 lpDCB [in] 一个氯苯结构,它包含了指定的设备配置信息通信的指针。 返回值 如果函数成功,返回值为非零。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 该SetCommState函数使用一个氯苯结构来指定需要的配置。该GetCommState函数返回当前的配置。 要设置只对二氯苯结构的几个成员,您应该修改氯苯结构,填补了对GetCommState的电话。这确保了氯苯结构的其他成员适当的值。 该SetCommState函数失败如果氯苯结构XonChar成员等于XoffChar成员。 当SetCommState是用来配置8250,以下限制适用于为生技中心结构的ByteSize和停止位成员的值: 数据位的数目必须是5至8位。 实例 有关示例,请参阅配置通信资源。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 BuildCommDCB 通讯功能 通信资源 CreateFile 二氯苯 GetCommState 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年7月30日 ==英文原文==SetCommState Function Configures a communications device according to the specifications in a device-control block (a DCB structure). The function reinitializes all hardware and control settings, but it does not empty output or input queues. Syntax C++ BOOL WINAPI SetCommState( __in HANDLE hFile, __in LPDCB lpDCB ); Parameters hFile [in] A handle to the communications device. The CreateFile function returns this handle. lpDCB [in] A pointer to a DCB structure that contains the configuration information for the specified communications device. Return Value 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 . Remarks The SetCommState function uses a DCB structure to specify the desired configuration. The GetCommState function returns the current configuration. To set only a few members of the DCB structure, you should modify a DCB structure that has been filled in by a call to GetCommState. This ensures that the other members of the DCB structure have appropriate values. The SetCommState function fails if the XonChar member of the DCB structure is equal to the XoffChar member. When SetCommState is used to configure the 8250, the following restrictions apply to the values for the DCB structure's ByteSize and StopBits members: The number of data bits must be 5 to 8 bits. Examples For an example, see Configuring a Communications Resource . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also BuildCommDCB Communications Functions Communications Resources CreateFile DCB GetCommState Send comments about this topic to Microsoft Build date: 7/30/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/aa363436(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。