ClearCommError (kernel32)
Last changed: gibwar@gibixonline.com-67.42.187.10

.
Summary

C# Signature:

[DllImport("kernel32.dll")]
private static extern bool ClearCommError(
  [In] int hFile,
  [Out, Optional] uint lpErrors,
  [In, Out, Optional] ref COMSTAT lpStat
);

User-Defined Types:

COMSTAT

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

The following code:

COMSTAT stats = new COMSTAT();
ClearCommError(hComm, 0, ref stats);

will get you the statistics of the com port passed with hComm.

Alternative Managed API:

Do you know one? Please contribute it!

Documentation