NetReceiveCFindResponse Example for Delphi

procedure TForm1.LEADDicomNet1NetReceiveCFindResponse(ASender: TObject;
  hNet: Integer; nPresentationID, nMessageID: Smallint;
  const pszClass: WideString; nStatus, hDS: Integer);
var
   strPeerAddress: String;
   strStatus: String;
   strMsg: String;
   strFileName: String;
begin
   strPeerAddress:= LEADDICOMNet1.GetPeerAddress (hNet);

   if(nStatus = COMMAND_STATUS_PENDING)then
      strStatus:= 'COMMAND_STATUS_PENDING';

   if(nStatus = COMMAND_STATUS_SUCCESS)then
      strStatus:= 'COMMAND_STATUS_SUCCESS';

   if(nStatus = COMMAND_STATUS_CANCEL)then
      strStatus:= 'COMMAND_STATUS_CANCEL';

   strMsg:= '*** OnNetReceiveCFindResponse ***' + Chr(13) + 'Peer[' + strPeerAddress + ']' + Chr(13) + 'nPresentationID[' + IntToStr(nPresentationID) + ']' + Chr(13) + 'nMessageID[' + IntToStr(nMessageID) + ']' + Chr(13) + 'pszClass[' + pszClass + ']' + Chr(13) + 'strStatus[' + strStatus + ']' + Chr(13);

   if(hDS <> 0)then
   begin
       gnFileCount:= gnFileCount + 1;
       strFileName:= 'd:\temp\CFind' + IntToStr(gnFileCount) + '.dic';
       LEADDicomDS1.SaveExtDS(hDS, strFileName, 0);
       strMsg:= strMsg + 'Saving[' + strFileName + ']';
   end;
   ShowMessage(strMsg);
end;