*gnarf* Das kommt davon, wenn man ohne Kaffee arbeitet
so sollte es jetzt passen:
Delphi-Quellcode:
function TBackgroundCopyService.DownloadMultiUrl(const aURL, aDest: TWideStringDynArray;
const aDownloadFeedback: TDownloadProgressEvent;
const aDisplayName: WideString;
const aJobType: BG_JOB_TYPE = BG_JOB_TYPE_DOWNLOAD): Boolean;
var
DownloadInfo: PBgFileInfo;
Info: array of BG_FILE_INFO;
nCount: Integer;
begin
if Assigned(CopyJob) then
CopyJob := nil;
if not Succeeded(GetNewJob(PWideChar(aDisplayName), aJobType, CopyJob)) then
RaiseLastOSError;
SetLength(Info, Length(aUrl));
ZeroMemory(@Info, SizeOf(Info));
for nCount := Low(aURL) to High(aURL) do
begin
with Info[nCount] do
begin
RemoteName := PWideChar(aUrl[nCount]);
LocalName := PWideChar(aDest[nCount]);
end;
end;
DownloadInfo := @Info;
nCount := Length(aURL);
if not Succeeded(CopyJob.AddFileSet(nCount, DownloadInfo)) then
RaiseLastOSError;
Result := ResumeJob(aJobType, aDownloadFeedback);
SetLength(Info, 0);
CopyJob := nil;
end;