SetMutualAuthKeyISCL Example for VB.NET
<StructLayout(LayoutKind.Sequential)> Public Class
KeyLoHi
Public LoValue As UInt32
Public HiValue As UInt32
End Class
<StructLayout(LayoutKind.Sequential)> Public Class
Key64
Public Value As UInt64
End Class
'LEADDICOMNet1 is a predefined LEADDicomNet object
Private Sub TestSetMutualAuthKeyISCL ()
Dim key As Key64
Dim compKey As KeyLoHi
Dim UnManagedMemory As IntPtr
key = New Key64
compKey = New KeyLoHi
UnManagedMemory = Marshal.AllocHGlobal(Marshal.SizeOf(compKey))
' use a 64 bit key value of 0123456789ABCDEF hex.
compKey.HiValue = System.Convert.ToUInt32(&H1234567L)
compKey.LoValue = Convert.ToUInt32(&H89ABCDEFL)
key.Value = Convert.ToUInt64(0)
Marshal.StructureToPtr(compKey, UnManagedMemory, True)
Marshal.PtrToStructure(UnManagedMemory, key)
LEADDICOMNet1.SetMutualAuthKeyISCL(LEADDICOMNet1.hNet,
1, key.Value)
LEADDICOMNet1.SetIndexForMutualAuthISCL(LEADDICOMNet1.hNet,
1)
MessageBox.Show("Index value is: " & LEADDICOMNet1.GetIndexForMutualAuthISCL(LEADDICOMNet1.hNet))
End Sub