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

.
Summary

C# Signature:

[DllImport("kernel32.dll")]
private static extern bool ClearCommError(
  [In] IntPtr hFile, // not int, convert int to IntPtr: new IntPtr(12)
  [Out, Optional] out uint lpErrors,
  [Out, Optional] out COMSTAT lpStat
);

User-Defined Types:

COMSTAT

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

The following code:

COMSTAT stats = new COMSTAT();
uint flags = 0;
ClearCommError(hComm, out flags, out stats);

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

Alternative Managed API:

Do you know one? Please contribute it!

Documentation