Disconnect

Function

Objective

The function is used to disconnect the device.

Parameter description

handle [in]: The handle that is returned when the connection is successful.

Returned value

None

Example

self.commpro.Disconnect(self.hcommpro) self.hcommpro = 0

Disconnect(h); h = IntPtr.Zero;

 

Ejemplo

C#

        [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;

            }
        }

VB

    <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