Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API_AppRun
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00795825
Message ID:
00796097
Vues:
27
Hi Steve,

I tested your code with Notepad and it works fine. What problem do you have?
cpathname = "C:\winnt\"
inparams = "H:\temp\test.txt"
SET CLASSLIB TO PROCESS.VCX ADDITIVE
lcCommandline = 'NOTEPAD.EXE '+inparams
oProcess = CREATEOBJ('API_AppRun',lcCommandline,cpathname, "NOR")
oProcess.LaunchAppAndWait()
You can also use WSH http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsMthRun.asp
cpathname = "C:\winnt\"
inparams = "H:\temp\test.txt"
lcCommandline = 'NOTEPAD.EXE '+inparams

oShell = CREATEOBJECT('WScript.Shell')
oShell.Run(lcCommandline,,.T.)
I would recomend your "file flag" approach as a last resort. You can use Win API Sleep function to wait specified period of time w/o using PC resources.
DECLARE Sleep IN WIN32API Long
Sleep(3000)		&& Delay 3 sec
>Sergey,
>
>Somehow the API_AppRun code did not work for me. Maybe I need to change how I am doing it... here is the code..
>			cpathname = "K:\SB\SB_RDE\SETSITE55\SBAFaria\"
>			inparams = ALLTRIM(m.initargetdir)
>			thisform.hide     && hide form
>			
>			***new code..
>			SET CLASSLIB TO PROCESS.VCX ADDITIVE
>			lcCommandline = 'ISPACCTS.EXE '+inparams
>			oProcess = CREATEOBJ('API_AppRun',lcCommandline,cpathname,'NOR')
>			oProcess.LaunchAppAndWait()
>
>Somehow this doesn't work for me. I am almost satisfied with another approach using ShellExecute and waiting for the called EXE to delete a flagfile. But, the processor is making a lot of noise while the do while loop is looking at the flagfile.
>
>Is there something I could use to minimize the processor use during a "do while file(flagfile)" loop? I tried "wait timeout 1" in the loop but it wrote to my form while it was hidden. Ugly result.
>
>- Steve
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform