General information
Category:
Windows API functions
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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only