WinExec+Delphi 2010

Delphi

11/03/2010

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...    
Jorge Silva

Jorge Silva

Curtidas 1

Melhor post

Wilson Junior

Wilson Junior

11/03/2010

Coloque:
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.
GOSTEI 1

Mais Respostas

Jorge Silva

Jorge Silva

11/03/2010

Eu também fiz isso e não deu certo , erro não da mas não executa ,mas agradeço pela atenção ...
GOSTEI 1
POSTAR