Ver Mensaje Individual
  #1  
Antiguo 22-04-2021
LACV LACV is offline
Miembro
 
Registrado: oct 2015
Posts: 80
Reputación: 9
LACV Va por buen camino
Exclamation Access violation at address 006052F2

Buena tarde;

no encuentro el por que me genera este error

Access violation at address 006052F2


Código Delphi [-]
procedure TFrmUpdateCopy.BtnIniciarClick(Sender: TObject);
var
  Fuente, Destino, nameC: string;
  sPath: String;
  SR: TSearchRec;
begin

  Fuente := PChar(ExtractFilePath(Application.ExeName) + 'data\c\temp\update\');
  Destino := PChar(ExtractFilePath(Application.ExeName) + 'prueba\');

  sPath := Fuente;
  if sPath[Length(sPath)] <> '\' then
    sPath := sPath + '\';
  begin
    if FindFirst(sPath + '*.*', faAnyFile, SR) = 0 then
    begin
      repeat
        if (SR.Attr <> faDirectory) then
        begin
          Memo1.Lines.Add(SR.Name);
          Memo1.Lines.Add('Origen: ' + Fuente + SR.Name);
          Memo1.Lines.Add('Destino: ' + Destino + SR.Name);
          Memo1.Lines.Add(#13);

          Cancel := false;
          CopyFileEx(PChar(Fuente + SR.Name), PChar(Destino + SR.Name),
            @ProgressRoutine, nil, @Cancel, COPY_FILE_RESTARTABLE or
            COPY_FILE_NO_BUFFERING);
          ShowMessage(SysErrorMessage(GetLastError()));
        end;
      until FindNext(SR) <> 0;
      FindClose(SR);

    end;
  end;

end;
modifique el codigo de esta forma para copiar diversos archivos del directorio, pero no logro entender el por que me arroja el error de Access violation at address 006052F2
Responder Con Cita