Ver Mensaje Individual
  #4  
Antiguo 03-02-2011
lucila89 lucila89 is offline
Registrado
NULL
 
Registrado: feb 2011
Posts: 4
Reputación: 0
lucila89 Va por buen camino
tengo un problema para leer el archivo o no lo entendí bien, osea en el readFile del ejemplo usaste un string como salida, en el link vi que la salida seria el buffer.
por ejemplo este código no me anda.

Código Delphi [-]
program Mayuscula;
uses windows,sysutils;
var
archivo,archivo2: LPCTSTR;
entrada, salida: Integer; 
stRead, stWrite:string;
NR, NW: LongWord;
begin
archivo:= 'D:\texto.txt';
archivo2:= 'D:\texto2.txt';
entrada:= CreateFile(archivo, GENERIC_READ + GENERIC_WRITE, FILE_SHARE_WRITE, NIL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
salida:= CreateFile(archivo2, GENERIC_READ + GENERIC_WRITE, FILE_SHARE_WRITE, NIL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
ReadFile(entrada, stRead, length(stRead), NR, NIL);
  stWrite:= uPcase(stRead);
  WriteFile(salida, stWrite[1], Length(stWrite), NW, NIL);
CloseHandle(entrada);
CloseHandle(salida);
end.

que esta mal en el codigo?

Última edición por lucila89 fecha: 03-02-2011 a las 14:30:20.
Responder Con Cita