InsertUID Example for Visual Basic
Private Sub Command10_Click()
Dim nRet As Integer
Dim ItemX As ListItem
LEADDICOM1.EnableMethodErrors = False
nRet = LEADDICOM1.FindUID("1.2.840.10008.1.3")
If (nRet = 0) Then
MsgBox "Already Exists!"
Exit Sub
End If
LEADDICOM1.EnableMethodErrors = True
On Error GoTo INSERTUIDERROR
nRet = LEADDICOM1.InsertUID("1.2.840.10008.1.3", "My Test UID", DICOM_UID_TYPE_OTHER)
If (nRet <> 0) Then
MsgBox "Error"
End If
'add item to the ListView control
Set ItemX = ListView1.ListItems.Add()
ItemX.Text = CStr(LEADDICOM1.CurrentUID.Code)
ItemX.SubItems(1) = LEADDICOM1.CurrentUID.Name
Set ListView1.SelectedItem = ListView1.FindItem(ItemX.Text)
ListView1.Refresh
ListView1.SetFocus
LEADDICOM1.EnableMethodErrors = True
Exit Sub
INSERTUIDERROR:
MsgBox "Error"
End Sub