tramontina Posted April 11, 2013 Report Share Posted April 11, 2013 Boa noite, Necessito executar um aplicativo externo windows e infelizmente o winexec não funciona em 64 bits, gostaria de saber se alguém poderia me ajudar informando qual a função que substitui o winexec ? Desde já agradeço. Emerson Tramontina Quote Link to comment Share on other sites More sharing options...
sistem Posted April 11, 2013 Report Share Posted April 11, 2013 tive o mesmo problema com winexec e shellExecute com Win7 64 bit e win2008R2 64bit subistitui por ex: cComando:= "-u root -pSENHA --all-databases > "+cDirName+"\backupD"+strtran(dtos(Date()), "/","")+"T"+Strtran(time(), ":", "")+".sql" MsgRun( "Gerando backup, este processo poderá levar alguns minutos", "Aguarde!", { || MYRUN(oApp:cDir_001+"mysqldump "+cComando) } ) Function MYRUN( cComando ) Local oShell, RET oShell := CreateObject( "WScript.Shell" ) RET := oShell:Run( "%comspec% /c " + cComando, 0, .T. ) oShell := NIL Return iif( RET = 0, .T., .F. ) Quote Link to comment Share on other sites More sharing options...
tramontina Posted April 11, 2013 Author Report Share Posted April 11, 2013 amigao, com sua dica acima estou tentando executar o adobe mais o windows nao esta respondendo ao comando, com esse comando acima consigo executar aplivativo tipo o adobe ? segue como estou mandando o comando para a função: MsgRun( 'Abrindo Arquivo PDF. Aguarde por favor...','Aguarde ',{|| ExecWin(_adobe+'acrord32.exe '+_decript+'\'+cProcdec+'.pdf') } ) o objeto oapp deu erro ao compilar, por isso que tirei. Quote Link to comment Share on other sites More sharing options...
tramontina Posted April 11, 2013 Author Report Share Posted April 11, 2013 consegui solucionar... MsgRun( 'Abrindo Arquivo PDF. Aguarde por favor...','Aguarde ',{|| ExecWin('acrord32.exe '+_decript+'\'+cProcdec+'.pdf') } ) Function ExecWIN( cComando )Local oShell, RET oShell := CreateObject( "WScript.Shell" ) RET := oShell:Run( cComando, 0, .T. ) oShell := NILReturn iif( RET = 0, .T., .F. )E agradeço muito a dica acima, foi porreta. Emerson Quote Link to comment Share on other sites More sharing options...
alex2002 Posted April 11, 2013 Report Share Posted April 11, 2013 Eu acho que conheço este "Tramontina". Não sei de onde. rsrsrsrsrsrs Um abraço, Quote Link to comment Share on other sites More sharing options...
oribeiro Posted April 12, 2013 Report Share Posted April 12, 2013 Simplesmente substituà a função nativa por essa ( com o mesmo nome ) e está tudo funcionando. ****************************************************************************** Function WinExec( cComando ) // Essa função substitui o WinExec() para Win64 bits ****************************************************************************** // Versão.: IncluÃda em 12-04-2013 no OASyS. // Exemplo: MsgRun('Abrindo Arquivo PDF. Aguarde por favor...','Aguarde ',; // {|| WinExec('acrord32.exe '+_decript+'\'+cProcdec+'.pdf')}) Local oShell, nRet oShell := CreateObject( "WScript.Shell" ) nRet := oShell:Run( cComando, 0, .T. ) oShell := NIL Return iif(nRet=0, .T., .F.) Quote Link to comment Share on other sites More sharing options...
Yury Posted April 12, 2013 Report Share Posted April 12, 2013 boa tarde pessoal testei o WinExec e ShellExecute com Win 8 e Win 7, ambos 64 bits e funcionou ok, 100 % vejam: cComand:='RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8' nRet:=WinExec(cComand) ? nRet cArquivo:='Teste.TXT' cComand:='Notepad '+cArquivo nRet:=WinExec(cComand) ? nRet cComand:='www.google.com.br' nRet:=ShellExecute(GetActiveWindow(),"open",'"'+cComand+'"') ? nRet será q existe mesmo essa limitação ? abraço Yury xHB build 1.1.0 (SimpLex) & BCC 5.5.1 & FW 8.01 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.