SetCommandSet (DICOM Control) Example for Visual Basic

Private Sub LEADDICOMNet1_NetReceiveData(ByVal hNet As Long, ByVal nID As Integer, ByVal hDicomCS As Long, ByVal hDicomDS As Long)
    Dim nRet As Integer

    'we have received a data message
    'copy the Command Set so we can examine its elements
    LEADDICOM1.SetCommandSet hDicomCS
    nRet = LEADDICOM1.FindFirstElement (TAG_COMMAND_FIELD, False)
    nRet = LEADDICOM1.GetShortValue (0, 1)
    MsgBox "Command Field = 0x" & Hex$(LEADDICOM1.ShortValues(0))
End Sub