IsRoleSelect Example for Delphi
var
x: Integer;
nID: Integer;
szOut: String;
nUser: Integer;
nProvider: Integer;
begin
//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 do
begin
nID:= LEADDICOMNet1.GetPresentationID (LEADDICOMNet1.hPDU, x);
LEADDICOMNet1.SetRoleSelect(LEADDICOMNet1.hPDU, nID, True, PDU_ROLE_SUPPORT, PDU_ROLE_NON_SUPPORT);
end;
//now, display the information
szOut:= 'Role Select Info' + Chr(13);
for x:= 0 to LEADDICOMNet1.GetPresentationCount (LEADDICOMNet1.hPDU) - 1 do
begin
nID:= LEADDICOMNet1.GetPresentationID (LEADDICOMNet1.hPDU, x);
szOut:= szOut + 'ID: ' + IntToStr(nID);
if(LEADDICOMNet1.IsRoleSelect(LEADDICOMNet1.hPDU, nID) = True)then
begin
nUser:= LEADDICOMNet1.GetUserRole(LEADDICOMNet1.hPDU, nID);
nProvider:= LEADDICOMNet1.GetProviderRole(LEADDICOMNet1.hPDU, nID);
szOut:= szOut + ' User: ' + IntToStr(nUser);
szOut:= szOut + ' Provider: ' + IntToStr(nProvider) + Chr(13);
end
else
szOut:= szOut + ' No Role Select' + Chr(13);
end;
ShowMessage(szOut);
end;