The function is used to disconnect the device.
handle [in]: The handle that is returned when the connection is successful.
None
self.commpro.Disconnect(self.hcommpro) self.hcommpro = 0
Disconnect(h); h = IntPtr.Zero;
[DllImport("plcommpro.dll", EntryPoint = "Disconnect")] public static extern void Disconnect(IntPtr h); private void btndisconncet_Click(object sender, EventArgs e) { Disconncet_Pull(); } private void Disconncet_Pull() { if (IntPtr.Zero != h) { Disconnect(h); h = IntPtr.Zero; } }
<DllImport("plcommpro.dll", EntryPoint:="Disconnect")> Public Shared Sub Disconnect(h As IntPtr) End Sub Private Sub Disconncet_Pull() If IntPtr.Zero <> h Then Disconnect(h) h = IntPtr.Zero End If End Sub