Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateProcess Problems
Message
De
20/11/2003 17:44:25
 
 
À
20/11/2003 15:21:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00852013
Message ID:
00852118
Vues:
16
This is interesting. Shellexecute works fine instead of createprocess except that shellexecute does not pause program execution until TransMan.exe exits which is what I need to happen. Any ideas on how to pause program execution?
DECLARE INTEGER ShellExecute IN "Shell32.dll" ;
	INTEGER hwnd, ;
	STRING lpVerb, ;
	STRING lpFile, ;
	STRING lpParameters, ;
	STRING lpDirectory, ;
	LONG nShowCmd

Exepath="c:\Program Files\IVANS\TransMan\Transman.exe"
=Shellexecute(0,"Open",Exepath," /A /M:TECHSUPPORT;SYSERROR;TMCONFIG;AIDOWN","c:\Program Files\IVANS\TransMan",0)
RETURN
>Have you tried launching cmd.exe instead of transman.exe? Nice for debugging things like this.
>
>Some programs are picky about getting a fully qualified name for argv[0] (first param of CreateProcess()). Some others dislike being started from paths containing blanks unless the executable name is quoted in a certain way, because their command line parsing code is broken. Such a program would think that it resides in a folder called "c:\program" or that "program" is its own name and the path is "c:\", when it is actually located in "c:\program files\what\ever".
>
>So you could try passing a fully qualified name as the first param for CreateProcess() but you could also pass .null. for the first parameter and build a complete command line (including the executable name) for the second parameter. Windows will do path searching for program names in the second parameter but not in the first, and it will probably supply the full path to the program even if you pass an unqualified name in the second parameter.
>
>E.g., assuming cmd.exe is in the path but not in the current directory, RunAndWait("cmd.exe") would fail but RunAndWait(.null., "cmd.exe") would not.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform