GetExtendedData Example for Delphi
var
x: Integer;
n: Integer;
strOut: String;
ExtData: OleVariant;
Data: OleVariant;
begin
//create the Associate Class as Request
LEADDICOMNet1.CreateAssociate (True);
//set the Associate to the default
LEADDICOMNet1.DefaultAssociate (LEADDICOMNet1.hPDU);
//add some extended data for the first presentation context
ExtData:= VarArrayCreate([0,4], varByte);
ExtData[0]:= 0;
ExtData[1]:= 1;
ExtData[2]:= 1;
ExtData[3]:= 0;
ExtData[4]:= 1;
//ExtData:= ttt;
LEADDICOMNet1.SetExtendedData(LEADDICOMNet1.hPDU, 1, ExtData, 5);
//now, display the information
n:= LEADDICOMNet1.GetExtendedDataLength (LEADDICOMNet1.hPDU, 1);
strOut:= 'Extended Data' + Chr(13);
Data:= LEADDICOMNet1.GetExtendedData(LEADDICOMNet1.hPDU, 1);
for x:= 0 to n - 1 do
begin
strOut:= strOut + IntToStr(x) + ' = ';
strOut:= strOut + IntToStr(Data[x]) + Chr(13);
end;
ShowMessage(strOut);
end;