SendNActionRequest Example for Visual Basic
'this sample shows how to send an N-ACTION-REQUEST
Dim nRet As Integer
Dim szClassUID As String
Dim szInstance As String
Dim nVR As Integer
Dim hPDU As Long
Dim nID As Integer
Dim nAction As Integer
'send an N-ACTION-REQUEST to the server
nAction = CInt(InputBox("What Action(1..10)?", "Action Request", 1))
szClassUID = InputBox("What class?", "Action Request", UID_BASIC_FILM_BOX_CLASS)
If (Len(szClassUID) < 1) Then Exit Sub
szInstance = InputBox("What instance?", "Action Request", "1.1.1.1")
If (Len(szInstance) < 1) Then Exit Sub
'here you would create a data set that encodes the Action Arguments
'for this example, we just load a dataset
'...
nRet = LEADDICOM1.LoadDS ("e:\images\dicom16.dic", 0)
hPDU = LEADDICOMNet1.GetAssociate (LEADDICOMNet1.hNet)
'now, send a request
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
LEADDICOMNet1.SendNActionRequest LEADDICOMNet1.hNet, nID, 1, szClassUID, szInstance, nAction, LEADDICOM1.hDicomDS