网站首页  词典首页

请输入您要查询的函数:

 

术语 buildcommdcb
释义 BuildCommDCB
语法:
C++
BOOL WINAPI BuildCommDCB(
__in LPCTSTR lpDef,
__out LPDCB lpDCB
);
BuildCommDCB函数
填补了在设备控制字符串中指定的值指定二氯苯结构。该设备控制字符串使用的模式命令语法。
参数
lpDef [in]
该设备控制信息。该函数这个字符串,分析它,然后设置在二氯苯结构适当的值指向lpDCB。
该字符串必须与模式命令的命令行参数相同的形式:
COMx [:] [波特= b的] [奇偶= p] [数据=?] [停止= ?] =(关于|关闭)[的] [xon =(关于|关闭)] [odsr =(关于|关闭) ] [价差=(关于|关闭)] [糖醇=(关于|关闭|房协)] [塞舌尔=(关于|关闭|房协|热)] [=(在idsr |关闭)]
该设备的名称是可选的,但它必须指定一个有效的设备如果使用。
例如,以下字符串指定一个1200波特率,无奇偶校验,8个数据位,1位停止位:
波特率= 1200平价= n个数据= 8站= 1
lpDCB [out]
一个氯苯结构,接收信息的指针。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
在BuildCommDCB函数调整的氯苯结构的具体参数影响的lpDef但下列情况例外,只有那些成员:
如果指定的波特率是110,该函数设置停止位为2留在系统的模式命令兼容。
默认情况下,BuildCommDCB禁用XON / XOFF和硬件流控制。要启用流量控制,您必须显式设置的氯苯结构的适当的成员。
在BuildCommDCB函数不仅填补在二氯苯结构的成员。为了将这些设置应用到串行端口,使用SetCommState函数。
有许多旧的模式的语法和新形式。 BuildCommDCB函数支持的两种形式。但是,您不能混淆的两种形式在一起。
在新的模式的语法形式让您显式设置对二氯苯的流量控制结构成员的值。如果您使用的是旧的模式的语法形式,BuildCommDCB函数设置的氯苯结构流量控制成员如下:
对于一个字符串,并没有结束带有X或P:
fInX,fOutX,fOutXDsrFlow和fOutXCtsFlow都设置为FALSE
fDtrControl设置为DTR_CONTROL_ENABLE
fRtsControl设置为RTS_CONTROL_ENABLE
对于一个字符串,结尾的x:
fInX和fOutX都设置为TRUE
fOutXDsrFlow和fOutXCtsFlow都设置为FALSE
fDtrControl设置为DTR_CONTROL_ENABLE
fRtsControl设置为RTS_CONTROL_ENABLE
对于一个字符串结尾一个p:
fInX和fOutX都设置为FALSE
fOutXDsrFlow和fOutXCtsFlow都设置为TRUE
fDtrControl设置为DTR_CONTROL_HANDSHAKE
fRtsControl设置为RTS_CONTROL_HANDSHAKE
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesBuildCommDCBW(Unicode)和BuildCommDCBA(ANSI)的
参见
通讯功能
通信资源
二氯苯
SetCommState
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==BuildCommDCB Function
Fills a specified DCB structure with values specified in a device-control string. The device-control string uses the syntax of the mode command.
Syntax
C++
BOOL WINAPI BuildCommDCB(
__in LPCTSTR lpDef,
__out LPDCB lpDCB
);
Parameters
lpDef [in]
The device-control information. The function takes this string, parses it, and then sets appropriate values in the DCB structure pointed to by lpDCB.
The string must have the same form as the mode command's command-line arguments:
COMx[:][baud=b][parity=p][data=d][stop=s][to={on|off}][xon={on|off}][odsr={on|off}][octs={on|off}][dtr={on|off|hs}][rts={on|off|hs|tg}][idsr={on|off}]
The device name is optional, but it must specify a valid device if used.
For example, the following string specifies a baud rate of 1200, no parity, 8 data bits, and 1 stop bit:
baud=1200 parity=N data=8 stop=1
lpDCB [out]
A pointer to a DCB structure that receives the information.
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 BuildCommDCB function adjusts only those members of the DCB structure that are specifically affected by the lpDef parameter, with the following exceptions:
If the specified baud rate is 110, the function sets the stop bits to 2 to remain compatible with the system's mode command.
By default, BuildCommDCB disables XON/XOFF and hardware flow control. To enable flow control, you must explicitly set the appropriate members of the DCB structure.
The BuildCommDCB function only fills in the members of the DCB structure. To apply these settings to a serial port, use the SetCommState function.
There are older and newer forms of the mode syntax. The BuildCommDCB function supports both forms. However, you cannot mix the two forms together.
The newer form of the mode syntax lets you explicitly set the values of the flow control members of the DCB structure. If you use an older form of the mode syntax, the BuildCommDCB function sets the flow control members of the DCB structure, as follows:
For a string that does not end with an x or a p:
fInX, fOutX, fOutXDsrFlow, and fOutXCtsFlow are all set to FALSE
fDtrControl is set to DTR_CONTROL_ENABLE
fRtsControl is set to RTS_CONTROL_ENABLE
For a string that ends with an x:
fInX and fOutX are both set to TRUE
fOutXDsrFlow and fOutXCtsFlow are both set to FALSE
fDtrControl is set to DTR_CONTROL_ENABLE
fRtsControl is set to RTS_CONTROL_ENABLE
For a string that ends with a p:
fInX and fOutX are both set to FALSE
fOutXDsrFlow and fOutXCtsFlow are both set to TRUE
fDtrControl is set to DTR_CONTROL_HANDSHAKE
fRtsControl is set to RTS_CONTROL_HANDSHAKE
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesBuildCommDCBW (Unicode) and BuildCommDCBA (ANSI)
See Also
Communications Functions
Communications Resources
DCB
SetCommState
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363143(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:31:35