SendCEchoResponse Example for VB.NET

'LEADDICOMNet1 is a predefined LEADDicomNet object
'LEADDICOM1 is a DICOM Dataset defined outside this method
'This example uses the predefined variable "TreeView1" of type "TreeView" from ".NET Framework".
Private Sub LEADDICOMNet1_NetReceiveCEchoRequest(ByVal hNet As Integer, ByVal nPresentationID As Short, ByVal nMessageID As Short, ByVal pszClass As String) Handles LEADDICOMNet1.NetReceiveCEchoRequest
   Dim nRet As Short
   Dim NewNode As System.Windows.Forms.TreeNode
   Dim szName As String
   NewNode = New System.Windows.Forms.TreeNode("Command Set - " & "C-ECHO-REQUEST")
   TreeView1.Nodes.Add(NewNode)
   NewNode.EnsureVisible()
   NewNode.Nodes.Add("Presentation ID: " & CStr(nPresentationID))
   NewNode.Nodes.Add("Message ID: " & CStr(nMessageID))
   nRet = LEADDICOM1.FindUID(pszClass)
   If (nRet = 0) Then
      szName = LEADDICOM1.CurrentUID.Name
      NewNode.Nodes.Add("Affected SOP Class: " & szName & " - " & pszClass)
   Else
      NewNode.Nodes.Add("Affected SOP Class: " & pszClass)
   End If
   'use high-level method to send a response
   LEADDICOMNet1.SendCEchoResponse(hNet, nPresentationID, nMessageID, pszClass, LTDNCLib.DicomCommandStatusConstants.COMMAND_STATUS_SUCCESS)
End Sub