Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute Failing
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01025967
Message ID:
01025988
Views:
15
>I have the following code. It had worked forever with no problems.
>Today I failed. The ShellExecute function is now returning 2.

Today You failed? I think I can not help you there <g>

If ShellExecute returns a value > 32 it was successfull, otherwise it will return one of this errors, in your case apparently is File not found
(copied from the docs)

0 The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.
ERROR_BAD_FORMAT The .exe file is invalid (non-Microsoft Win32® .exe or error in .exe image).
SE_ERR_ACCESSDENIED The operating system denied access to the specified file.
SE_ERR_ASSOCINCOMPLETE The file name association is incomplete or invalid.
SE_ERR_DDEBUSY The Dynamic Data Exchange (DDE) transaction could not be completed because other DDE transactions were being processed.
SE_ERR_DDEFAIL The DDE transaction failed.
SE_ERR_DDETIMEOUT The DDE transaction could not be completed because the request timed out.
SE_ERR_DLLNOTFOUND The specified dynamic-link library (DLL) was not found.
SE_ERR_FNF The specified file was not found.
SE_ERR_NOASSOC There is no application associated with the given file name extension. This error will also be returned if you attempt to print a file that is not printable.
SE_ERR_OOM There was not enough memory to complete the operation.
SE_ERR_PNF The specified path was not found.
SE_ERR_SHARE A sharing violation occurred

And the values for SE errors are (I think those ERROR_ have the same value as the corresponding SE_ constants):
#define SE_ERR_FNF      2
#define SE_ERR_PNF      3
#define SE_ERR_ACCESSDENIED     5
#define SE_ERR_OOM      8
#define SE_ERR_DLLNOTFOUND      32
#define SE_ERR_SHARE    26
#define SE_ERR_ASSOCINCOMPLETE  27
#define SE_ERR_DDETIMEOUT       28
#define SE_ERR_DDEFAIL  29
#define SE_ERR_DDEBUSY  30
#define SE_ERR_NOASSOC  31
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform