Fórum WinExec+Delphi 2010 #26204
11/03/2010
0
Pessoal estou com um probleminha no WinExec no delphi 2010 , migrei um sistema do delphi 7 para o 2010, tinha algumas funções com winExec e agora tenho as seguintes situações:
try
Screen.Cursor := crHourGlass;
if not(FileExists(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe')) then begin
DownloadFile('http://www.sysproinformatica.com.br/acessoremoto.exe',ExtractFilePathApplication.ExeName)'acessoremoto.exe');
end;
WinExec(PChar(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe'), SW_SHOWNORMAL);
finally
Screen.Cursor := crDefault;
end; retorno o seguinte erro:[DCC Error] U_SAC.pas(549): E2010 Incompatible types: 'Char' and 'AnsiChar' , sendo que no delphi 7 funcionava certinho ... Sendo assim fiz assim : try
Screen.Cursor := crHourGlass;
if not(FileExists(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe')) then begin
DownloadFile('http://www.sysproinformatica.com.br/acessoremoto.exe',ExtractFilePath(Application.ExeName)+'acessoremoto.exe');
end;
WinExec(PAnsiChar(PChar(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe')), SW_SHOWNORMAL);
finally
Screen.Cursor := crDefault; end; Resultado: Não da erro mas não executa nada , faz o download tudo , mas na hora de executar o programa não aparece nada ... Será que alguém pode me esclarecer o que esta errado e o porque? Desde já agradeço...
Screen.Cursor := crHourGlass;
if not(FileExists(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe')) then begin
DownloadFile('http://www.sysproinformatica.com.br/acessoremoto.exe',ExtractFilePathApplication.ExeName)'acessoremoto.exe');
end;
WinExec(PChar(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe'), SW_SHOWNORMAL);
finally
Screen.Cursor := crDefault;
end; retorno o seguinte erro:[DCC Error] U_SAC.pas(549): E2010 Incompatible types: 'Char' and 'AnsiChar' , sendo que no delphi 7 funcionava certinho ... Sendo assim fiz assim : try
Screen.Cursor := crHourGlass;
if not(FileExists(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe')) then begin
DownloadFile('http://www.sysproinformatica.com.br/acessoremoto.exe',ExtractFilePath(Application.ExeName)+'acessoremoto.exe');
end;
WinExec(PAnsiChar(PChar(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe')), SW_SHOWNORMAL);
finally
Screen.Cursor := crDefault; end; Resultado: Não da erro mas não executa nada , faz o download tudo , mas na hora de executar o programa não aparece nada ... Será que alguém pode me esclarecer o que esta errado e o porque? Desde já agradeço...
Jorge Silva
Curtir tópico
+ 1
Responder
Post mais votado
11/03/2010
Coloque:
Espero ter colaborado.
try
Screen.Cursor := crHourGlass;
if not(FileExists(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe')) then begin
DownloadFile('http://www.sysproinformatica.com.br/acessoremoto.exe',ExtractFilePath(Application.ExeName)+'acessoremoto.exe');
end;
WinExec(PAnsiChar(ExtractFilePath(Application.ExeName)+'\acessoremoto.exe'), SW_SHOWNORMAL);
finally
Screen.Cursor := crDefault;
end;
Espero ter colaborado.
Wilson Junior
Responder
Gostei + 1
Mais Posts
11/03/2010
Jorge Silva
Eu também fiz isso e não deu certo , erro não da mas não executa ,mas agradeço pela atenção ...
Responder
Gostei + 1
11/03/2010
Wilson Junior
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)