Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   C++ Builder (https://www.clubdelphi.com/foros/forumdisplay.php?f=13)
-   -   copiar un directorio (https://www.clubdelphi.com/foros/showthread.php?t=81768)

DOS994 16-12-2012 03:28:20

copiar un directorio
 
Hola a todos necesito traducir este codigo a Borland C++
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
 function CopiaTodo(Origen,Destino : String) :
  LongInt;
  var 
    F : TShFileOpStruct;
    sOrigen, sDestino : String;
  begin 
    Result := 0;
    sOrigen := Origen + #0;
    sDestino := Destino + #0;
 
    with F do 
    begin 
      Wnd   := Application.Handle;
      wFunc := FO_COPY;
      pFrom := @sOrigen[1];
      pTo   := @sDestino[1];
      fFlags := FOF_ALLOWUNDO or FOF_NOCONFIRMATION
    end; 
 
    Result := ShFileOperation(F);
end; 
 
begin 
  CopiaTodo('c:\Delphi3\*.*','c:\kk');
end;

Gracias de antemano

ecfisa 16-12-2012 06:12:57

Hola DOS994.

Código:

int CopiaTodo(String Origen, String Destino)
{
  SHFILEOPSTRUCT FOS = {0};
  FOS.wFunc  = FO_COPY;
  FOS.pFrom  = (Origen+"\0").c_str();
  FOS.pTo    = (Destino+"\0").c_str();
  FOS.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION;
  return SHFileOperation(&FOS);
}

Mas información: [SHFileOperation].

Saludos.


La franja horaria es GMT +2. Ahora son las 05:16:00.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi