Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Problemas con funcion (https://www.clubdelphi.com/foros/showthread.php?t=85916)

gdlrinfo 23-05-2014 20:33:15

Problemas con funcion
 
Hola amigos tengo la función que esta mas abajo que me copia un archivo de un directorio a otro el problema es cuando quiero copiar muchos archivos por ejemplo
CopiaTodo('L:\act\*.xls ', 'L:\OPE\*.xls');
Suponiendo que ahí dentro hay muchos archivos si pongo el comodin hace el proceso pero no me los copia como podría solucionarlo gracias como siempre

Código Delphi [-]
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 or FOF_SIMPLEPROGRESS;
     end;
     Result := ShFileOperation(F);
 end;

ecfisa 23-05-2014 21:28:20

Hola gdlrinfo.

En este enlace: SHFILEOPSTRUCT structure podemos leer:
Cita:

...
pTo

Type: PCZZTSTR

Note This string must be double-null terminated.

A pointer to the destination file or directory name. This parameter must be set to NULL if it is not used. Wildcard characters are not allowed. Their use will lead to unpredictable results.
...
Aquí lo confirma: Using Wildcard Extension with SHFileOperation.

Saludos :)


La franja horaria es GMT +2. Ahora son las 11:48:11.

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