GetExtendedData Example for VB.NET

'This example uses the predefined variable "LEADDICOMNet1" of type "LEADDicomNet" from "LEADTOOLS Toolkit".
Private Sub TestGetExtendedData ( )
   Dim x As Integer
   Dim n As Integer
   Dim szOut As String
   Dim ExtData As Object
   Dim Data As Object
   Dim ttt(4) As Byte

   'create the Associate Class as Request
   LEADDICOMNet1.CreateAssociate(True)
   'set the Associate to the default
   LEADDICOMNet1.DefaultAssociate(LEADDICOMNet1.hPDU)

   'add some extended data for the first presentation context ttt(0) = 0 ttt(1) = 1 ttt(2) = 1 ttt(3) = 0 ttt(4) = 1

   ExtData = ttt LEADDICOMNet1.SetExtendedData(LEADDICOMNet1.hPDU, 1, ExtData, 5)

   'now, display the information
   n = LEADDICOMNet1.GetExtendedDataLength(LEADDICOMNet1.hPDU, 1)
   szOut = "Extended Data" & Chr(13)

   Data = LEADDICOMNet1.GetExtendedData(LEADDICOMNet1.hPDU, 1)
   For x = 0 To n - 1
      szOut = szOut & CStr(x) & " = "
      szOut = szOut & CStr(Data(x)) & Chr(13)
   Next
   MessageBox.Show(szOut)

End Sub