COM_Open

This function initializes the serial port driver.

HANDLE COM_Open(
  HANDLE pContext,
  DWORD AccessCode,
  DWORD ShareMode 
);

Parameters

  • pContext
    [in] Pointer to a handle returned by the COM_Init function.
  • AccessCode
    [in] Specifies the access level requested by the caller, such as shared read or read/write.
  • ShareMode
    [in] Specifies the sharing mode that the calling application passed to the CreateFile function.

Return Values

Returns a handle representing the serial port.

Remarks

The user calls this function to open the serial device. The HANDLE returned must be used by the application in all subsequent calls to the serial driver. This function starts the thread that handles the serial events. This function is exported to applications through CreateFile. If you want to support the Telephony API (TAPI), and you are writing your own serial port upper layer, ensure that the upper layer supports multiple COM_Open requests from applications. The serial port upper layer implementations supplied by Microsoft all meet this requirement.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Developer defined.
Library: Serial.lib.

See Also

COM_Close | COM_Init | CreateFile

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.