KroSaver
20-02-2013, 13:01:59
Hola muy buenas a todos mire me estoy iniciando en Delphi y tengo unos problemas con una aplicacion que estoy haciendo y es con los archivos de texto.
Me salta un error muy raro que no entiendo que es en en la linea Append(Logs); de este code:
uses
Windows,SysUtils;
var
Logs: TextFile;
DirLogs: String;
Caracter: Integer;
Ventana: HWND;
VentanaA: array [0..MAX_PATH] of Char;
VentanaB: array [0..MAX_PATH] of Char;
begin
DirLogs := 'C:\kr.txt';
if FileExists(DirLogs) then
else
begin
AssignFile( Logs, DirLogs );
Rewrite( Logs );
WriteLn(Logs,'>-----< PROVANDO >-----<');
CloseFile(Logs);
end;
while(true)do
begin
sleep(20);
Ventana:=GetForegroundWindow();
GetWindowText(Ventana,VentanaA,MAX_PATH);
if(VentanaA<>VentanaB)then
begin
Append(Logs);
Writeln(Logs,'PROVANDO');
CloseFile(Logs);
VentanaA := VentanaB;
end;
end;
end.
El error que da es este:
Project Project1.exe raised exception class EInOutError with message "I/O error 102". Process stopped. Use Step or Run to continue.
Y otro error esta en la linea VentanaA := VentanaB; me dice que son tipos incompatibles :eek: algo que en IDE Lazarus no me dava este error y me funcionaba bien.
Para este code uso Delphi 7 Enterprise.
gracias de antemano y saludos.
Me salta un error muy raro que no entiendo que es en en la linea Append(Logs); de este code:
uses
Windows,SysUtils;
var
Logs: TextFile;
DirLogs: String;
Caracter: Integer;
Ventana: HWND;
VentanaA: array [0..MAX_PATH] of Char;
VentanaB: array [0..MAX_PATH] of Char;
begin
DirLogs := 'C:\kr.txt';
if FileExists(DirLogs) then
else
begin
AssignFile( Logs, DirLogs );
Rewrite( Logs );
WriteLn(Logs,'>-----< PROVANDO >-----<');
CloseFile(Logs);
end;
while(true)do
begin
sleep(20);
Ventana:=GetForegroundWindow();
GetWindowText(Ventana,VentanaA,MAX_PATH);
if(VentanaA<>VentanaB)then
begin
Append(Logs);
Writeln(Logs,'PROVANDO');
CloseFile(Logs);
VentanaA := VentanaB;
end;
end;
end.
El error que da es este:
Project Project1.exe raised exception class EInOutError with message "I/O error 102". Process stopped. Use Step or Run to continue.
Y otro error esta en la linea VentanaA := VentanaB; me dice que son tipos incompatibles :eek: algo que en IDE Lazarus no me dava este error y me funcionaba bien.
Para este code uso Delphi 7 Enterprise.
gracias de antemano y saludos.