网站首页  词典首页

请输入您要查询的函数:

 

术语 setupcomm
释义 SetupComm
语法:
C++
BOOL WINAPI SetupComm(
__in HANDLE hFile,
__in DWORD dwInQueue,
__in DWORD dwOutQueue
);
SetupComm函数
为指定的通信设备通信参数初始化。
参数
hFile [in]
一个句柄,通信设备。 CreateFile函数返回此句柄。
dwInQueue [in]
该器件的内部输入缓冲区推荐的大小,以字节为单位。
dwOutQueue [in]
该器件的输出缓冲器内部推荐的大小,以字节为单位。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
经过一个过程使用CreateFile函数打开的句柄通讯设备,但在做任何与该设备的I / O,它可以调用SetupComm设置设备的通信参数。如果没有设置它们,该设备使用默认参数时,在第一次调用另一个通讯功能发生。
在dwInQueue和dwOutQueue参数指定由指定的设备驱动程序使用的内部缓冲区大小的建议。例如,YMODEM协议数据包稍大于1024字节。因此,建议缓冲区大小可能是1200 YMODEM通信字节。对于基于以太网的通信,推荐的缓冲区大小可能是1600字节,它是略高于一个更大的以太网帧。
该设备驱动程序收到建议的缓冲区大小,但可以自由使用任何输入和输出(I / O)的缓冲计划,只要提供合理的性能和数据不丢失,由于超支(在极端情况下除外)。例如,函数可以取得成功,即使司机不分配一个缓冲区,只要有系统的其他部分提供等效的功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
通讯功能
通信资源
CreateFile
SetCommState
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==SetupComm Function
Initializes the communications parameters for a specified communications device.
Syntax
C++
BOOL WINAPI SetupComm(
__in HANDLE hFile,
__in DWORD dwInQueue,
__in DWORD dwOutQueue
);
Parameters
hFile [in]
A handle to the communications device. The CreateFile function returns this handle.
dwInQueue [in]
The recommended size of the device's internal input buffer, in bytes.
dwOutQueue [in]
The recommended size of the device's internal output buffer, in bytes.
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
After a process uses the CreateFile function to open a handle to a communications device, but before doing any I/O with the device, it can call SetupComm to set the communications parameters for the device. If it does not set them, the device uses the default parameters when the first call to another communications function occurs.
The dwInQueue and dwOutQueue parameters specify the recommended sizes for the internal buffers used by the driver for the specified device. For example, YMODEM protocol packets are slightly larger than 1024 bytes. Therefore, a recommended buffer size might be 1200 bytes for YMODEM communications. For Ethernet-based communications, a recommended buffer size might be 1600 bytes, which is slightly larger than a single Ethernet frame.
The device driver receives the recommended buffer sizes, but is free to use any input and output (I/O) buffering scheme, as long as it provides reasonable performance and data is not lost due to overrun (except under extreme circumstances). For example, the function can succeed even though the driver does not allocate a buffer, as long as some other portion of the system provides equivalent functionality.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Communications Functions
Communications Resources
CreateFile
SetCommState
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363439(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:26:04