UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:winbase.OpenCommPort |
OpenCommPort function (winbase.h) |
Attempts to open a communication device. |
|
base\opencommport.htm |
base |
D96D3F6D-2158-4E6A-84A8-DC3BAE9624FA |
12/05/2018 |
FILE_FLAG_OVERLAPPED, OpenCommPort, OpenCommPort function, base.opencommport, winbase/OpenCommPort |
winbase.h |
Windows.h |
Windows |
Windows 10, version 1709 [desktop apps \| UWP apps] |
Windows Server, version 1709 [desktop apps \| UWP apps] |
OneCore.lib |
KernelBase.dll |
Windows |
19H1 |
|
|
|
|
|
|
Attempts to open a communication device.
A one-based port number for the communication device to open.
The requested access to the device.
For more information about requested access, see CreateFile and Creating and Opening Files.
The requested flags and attributes to the device.
Note
For this function, only values of FILE_FLAG_OVERLAPPED or 0x0 are expected for this parameter.
Value | Meaning |
---|---|
|
The file or device is being opened or created for asynchronous I/O. |
If the function succeeds, the function returns a valid HANDLE. Use CloseHandle to close that handle.
If an error occurs, the function returns INVALID_HANDLE_VALUE.
The uPortNumber parameter accepts one-based values. A value of 1 for uPortNumber causes this function to attempt to open COM1.
To support UWP, link against WindowsApp.lib.