SendNCreateRequest Example for Visual Basic
Dim szClassUID As String
Dim szInstanceUID As String
Dim nID As Integer
Dim hPDU As Long
Dim nRet As Integer
hPDU = LEADDICOMNet1.GetAssociate (LEADDICOMNet1.hNet)
szClassUID = InputBox("Enter SOP Class to Create:", "Create", UID_SC_IMAGE_STORAGE)
szInstanceUID = InputBox("Enter SOP Instance to Create:", "Create", "1.2.840.113619.2.30.1.1762288927.1489.906240296.255")
'send a Create Request Command to the server
nID = LEADDICOMNet1.FindPresentationAbstract (hPDU, szClassUID)
If (nID = 0) Then
nRet = LEADDICOM1.FindUID(szClassUID)
If (nRet = 0) Then
MsgBox "Abstract Syntax, " & LEADDICOM1.CurrentUID.Name & ", Not Supported by Association!"
Else
MsgBox "Abstract Syntax, " & szClassUID & ", Not Supported by Association!"
End If
Exit Sub
End If
'here, you should construct a Data Set that contains the attributes
'and values for the new SOP Instance.
'In this sample, we simply load a Data Set from a file on disk
'pick the data set to send
nRet = LEADDICOM1.LoadDS ("e:\images\dicom16.dic", 0)
'send a Delete Request message
LEADDICOMNet1.SendNCreateRequest LEADDICOMNet1.hNet, nID, 999, szClassUID, szInstanceUID, LEADDICOM1.hDicomDS