[DllImport("kernel32.dll")]
static extern bool BuildCommDCB(string lpDef, [Out] ref DCB lpDCB);
None.
Note that to use this function you have to prepare dcb structure (see at pinvoke.net)
Please add some!
Dcb dcb = new Dcb();
dcb.DCBLength = (uint)System.Runtime.InteropServices.Marshal.SizeOf(dcb);
dcb.Binary = true;
string portParams = "baud="BoudRate.ToString()" parity="ParityDB.ToString()" data="DataBit.ToString()" stop="+StopBit.ToString();
if (!BuildCommDCB(portParams, ref dcb))
{
MessageBox.Show("Error: BuildComm()");
return (IntPtr)INVALID_HANDLE_VALUE;
}
Do you know one? Please contribute it!