SendNCreateResponse Example for Visual Basic
Private Sub LEADDICOMNet1_NetReceiveNCreateRequest(ByVal hNet As Long, ByVal nPresentationID As Integer, ByVal nMessageID As Integer, ByVal pszClass As String, ByVal pszInstance As String, ByVal hDS As Long)
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-CREATE-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 would perform the actual creation of the SOP Instance
nRet = PerformCREATECommand(pszClass, pszInstance, hDS)
If (nRet <> DICOM_SUCCESS) Then nRet = COMMAND_STATUS_PROCESSING_FAILURE
'send a response
szReply = "Create Response Command Set Sent - "
'note, we simply send back the passed hDS in this sample
LEADDICOMNet1.SendNCreateResponse hNet, nPresentationID, nMessageID, pszClass, pszInstance, nRet, hDS
End Sub