SendNDeleteResponse Example for Visual Basic
Private Sub LEADDICOMNet1_NetReceiveNDeleteRequestNetReceiveNDeleteRequestEvent(ByVal hNet As Long, ByVal nPresentationID As Integer, ByVal nMessageID As Integer, ByVal pszClass As String, ByVal pszInstance As String)
Private Sub LEADDICOMNet1_NetReceiveNDeleteRequest(ByVal hNet As Long, ByVal nPresentationID As Integer, ByVal nMessageID As Integer, ByVal pszClass As String, ByVal pszInstance As String)
Dim nRet As Integer
Dim NewNode As Node
Dim szReply As String
Dim lParent As Long
Dim szName As String
Set NewNode = TreeView1.Nodes.Add(, , , "Command Set - " & "N-DELETE-REQUEST")
NewNode.EnsureVisible
lParent = NewNode.Index
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Presentation ID: " & CStr(nPresentationID))
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Message ID: " & CStr(nMessageID))
nRet = LEADDICOM1.FindUID(pszClass)
If (nRet = 0) Then
szName = LEADDICOM1.CurrentUID.Name
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Affected SOP Class: " & szName & " - " & pszClass)
Else
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Affected SOP Class: " & pszClass)
End If
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Affected SOP Instance: " & pszInstance)
'this is a function that you have to write
nRet = PerformDELETECommand(pszClass, pszInstance)
If (nRet <> DICOM_SUCCESS) Then nRet = COMMAND_STATUS_NO_SUCH_OBJECT_INSTANCE
'send a response
szReply = "Delete Response Command Set Sent - "
LEADDICOMNet1.SendNDeleteResponse hNet, nPresentationID, nMessageID, pszClass, pszInstance, nRet
MsgBox szReply & LEADDICOMNet1.GetPeerAddress (hNet)
End Sub