SendCEchoResponse Example for Visual Basic
Private Sub LEADDICOMNet1_NetReceiveCEchoRequest (ByVal hNet As Long, ByVal nPresentationID As Integer, ByVal nMessageID As Integer, ByVal pszClass As String)
Dim nRet As Integer
Dim NewNode As Node
Dim lParent As Long
Dim szName As String
Set NewNode = TreeView1.Nodes.Add(, , , "Command Set - " & "C-ECHO-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
'use high-level method to send a response
LEADDICOMNet1.SendCEchoResponse hNet, nPresentationID, nMessageID, pszClass, COMMAND_STATUS_SUCCESS
End Sub