FindModuleIOD Example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub TestFindModuleIOD()
   Dim szPrompt As String

   LEADDICOM1.EnableMethodErrors = True
   On Error GoTo FINDIODERROR
   'Find a Module
   LEADDICOM1.FindModuleIOD(LTDICLib.DicomClassConstants.DICOM_CLASS_CR_IMAGE_STORAGE, LTDICLib.DicomModuleConstants.DICOM_MODULE_BIPLANE_IMAGE)
   MessageBox.Show(LEADDICOM1.CurrentIOD.Name)

   LEADDICOM1.SetIODName("New IOD Name #1")
   LEADDICOM1.SetIODDescription("New IOD Description #1")
   szPrompt = "Name: " & LEADDICOM1.CurrentIOD.Name & Chr(13)
   szPrompt = szPrompt & "Desc: " & LEADDICOM1.CurrentIOD.Description
   MessageBox.Show(szPrompt)

   'Find a Class
   LEADDICOM1.FindClassIOD(LTDICLib.DicomClassConstants.DICOM_CLASS_PRINT_QUEUE)
   MessageBox.Show(LEADDICOM1.CurrentIOD.Name)

   LEADDICOM1.SetIODName("New IOD Name #2")
   LEADDICOM1.SetIODDescription("New IOD Description #2")
   szPrompt = "Name: " & LEADDICOM1.CurrentIOD.Name & Chr(13)
   szPrompt = szPrompt & "Desc: " & LEADDICOM1.CurrentIOD.Description
   MessageBox.Show(szPrompt)

   Exit Sub

FINDIODERROR:
   MessageBox.Show("Error")


End Sub