Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ShellExecute result codes
Message
De
18/06/1998 19:54:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00108874
Message ID:
00109755
Vues:
46
David,

We have a function called PrintForm that issues the following line of code:

liResult=DoShell("OPEN", "\FOX\FPRINT.EXE", lcPrintCmd, "", 0)

Of course, DoShell() is another function that issues:

DECLARE INTEGER ShellExecute IN Shell32;
INTEGER @HWND,;
STRING @lpOperation,;
STRING @lpFile,;
STRING @lpParameters,;
STRING @lpDirectory,;
INTEGER @nShowCmd

DECLARE LONG GetDesktopWindow IN WIN32API

LOCAL hWind, liResult

IF PARAMETERS() < 4 THEN && lcDirectory was not passed in.
&& Set default directory.
lcDirectory = "C:\"
ENDIF
IF PARAMETERS() < 5 THEN && liShowCmd was not passed in.
&& By default, we hide the command window.
liShowCmd = 0
ENDIF
IF PARAMETERS() < 6 THEN && llTellMe was not passed in.
&& By default, we don't explicitly notify user of the result.
llTellMe = .F.
ENDIF

hWind = GetDesktopWindow()

lcDirectory=lcDirectory+CHR(0) &&NULL-terminate the string.

&& Returned value >32 means operation successful
liResult = ShellExecute(@hWind,@lcOperation,@lcFile,@lcParameters,@lcDirectory,liShowCmd)

IF llTellMe THEN
IF liResult > 32 THEN
WAIT WINDOW "Operation Successful"
ELSE
WAIT WINDOW "Operation Encountered Problems: Code " + STR(liResult)
ENDIF
ENDIF

CLEAR DLLS
RETURN liResult

The strange thing is that this code works like a charm here in dev, but fails with a result code of 5 (access denied) in testing environments.

Thanks,

--Bruce
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform