IsRoleSelect Example for Visual Basic
Dim x As Long
Dim nID As Long
Dim szOut As String
Dim nUser As Integer
Dim nProvider As Integer
'create the Associate Class as Request
LEADDICOMNet1.CreateAssociate True
'set the Associate to the default
LEADDICOMNet1.DefaultAssociate LEADDICOMNet1.hPDU
'indicate that we wish to serve as user for each SOP associated
For x = 0 To LEADDICOMNet1.GetPresentationCount (LEADDICOMNet1.hPDU) - 1
nID = LEADDICOMNet1.GetPresentationID (LEADDICOMNet1.hPDU, x)
LEADDICOMNet1.SetRoleSelect LEADDICOMNet1.hPDU, nID, True, PDU_ROLE_SUPPORT, PDU_ROLE_NON_SUPPORT
Next
'now, display the information
szOut = "Role Select Info" & Chr(13)
For x = 0 To LEADDICOMNet1.GetPresentationCount (LEADDICOMNet1.hPDU) - 1
nID = LEADDICOMNet1.GetPresentationID (LEADDICOMNet1.hPDU, x)
szOut = szOut & "ID: " & CStr(nID)
If (LEADDICOMNet1.IsRoleSelect(LEADDICOMNet1.hPDU, nID) = True) Then
nUser = LEADDICOMNet1.GetUserRole(LEADDICOMNet1.hPDU, nID)
nProvider = LEADDICOMNet1.GetProviderRole(LEADDICOMNet1.hPDU, nID)
szOut = szOut & " User: " & CStr(nUser)
szOut = szOut & " Provider: " & CStr(nProvider) & Chr(13)
Else
szOut = szOut & " No Role Select" & Chr(13)
End If
Next
MsgBox szOut