Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Findexecutable returns 31, okay or bad news?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00252413
Message ID:
00252477
Views:
28
>>31 should mean that there's no application associated with the file. If the buffer that's being passed to the function isn't re-initialized, you could be seeing the results from the previous call to the function.
>>
>>Care to post a sample of what's going on Bruce?
>
>Sure, George:
>
>
>declare long FindExecutable in "shell32.dll" ;
>string cFile, string cDirectory, string @cResult
>
>cBuffer = space(255)
>nRetVal = FindExecutable("important.xls",'\\SMDSRV3\Sampling\Application\Executable' , @cBuffer)
>if nRetVal < 32
>  messageBox("You don't have Excel installed, sorry.",64)
>  return
>endif
>It runs okay somethimes, but not others. When I changed 32 to 31, it always seems to run fine. However, I have not tested it on a machine without Excel, and I'm concerned that may cause a problem.

Bruce,

Anything less than or equal to 32 is an error. 31 is SE_ERR_NOASSOC. 32 is SE_ERR_DLLNOTFOUND, which means pretty much what it says. If it helps, here are some of the error constant definitions:
#define SE_ERR_FNF              2   && file not found
#define SE_ERR_PNF              3   && path not found
#define SE_ERR_ACCESSDENIED     5   && access denied
#define SE_ERR_OOM              8   && out of memory
#define SE_ERR_SHARE            26  && A sharing violation occurred.
#define SE_ERR_ASSOCINCOMPLETE  27  && Filename association isn't complete or invalid.
#define SE_ERR_DDETIMEOUT       28  && DDE Transaction timed out
#define SE_ERR_DDEFAIL          29  && DDE Failure
#define SE_ERR_DDEBUSY          30  && DDE Busy
#define SE_ERR_NOASSOC          31  && No application associated
#define SE_ERR_DLLNOTFOUND      32
I should point out that many of these would only apply to using ShellExecute.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform