Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File 'shellexecute.prg' does not exist
Message
 
 
To
03/11/2022 08:34:34
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01685206
Message ID:
01685222
Views:
33
>>Hello,
>>
>>A couple of times I received email error message pointing to the fact that
>>'ShellExecute.prg' does not exist.
>>
>>In my code I do have calls to execute the ShellExecute (Windows API function) when printing PDF documents.
>>So, the ShellExecute is outside of what my program created.
>>
>>What would cause this error?
>>
>>TIA
>
>The command
>
>  DECLARE INTEGER ShellExecute IN "Shell32.dll" ;
>   INTEGER HWND, ;
>   STRING lpVerb, ;
>   STRING lpFile, ;
>   STRING lpParameters, ;
>   STRING lpDirectory, ;
>   LONG nShowCmd
>
>is not executed before
>
>ShellExecute( ....
>
>
>or CLEAR DLLS is executed between
>
>Possibly a third party tool clears the DLL, so it is good practice to have the DLL call like
>
>
>ShellExecute( ....
>
>FUNCTION  ShellExecute (tHWND, tlpVerb, tlpFile, tlpParameters, tlpDirectory, tnShowCmd)
>
> DECLARE INTEGER ShellExecute IN "Shell32.dll" ;
>    INTEGER HWND, ;
>    STRING lpVerb, ;
>    STRING lpFile, ;
>    STRING lpParameters, ;
>    STRING lpDirectory, ;
>    LONG nShowCmd
>
> RETURN  ShellExecute (tHWND, tlpVerb, tlpFile, tlpParameters, tlpDirectory, tnShowCmd )
>Endfunc
>
>
>Due to the way VFP calls functions, the FUNCTION is called only if the DLL is not declared. So if cleared, it's auto declared again.
>
>HTH
>Lutz

A follow up question. If I change my code to the one you suggest, are you saying that the call to
DECLARE INTEGER, inside the FUNCTION ShellExecute() will not produce anything, if it is called the second time? How would I see it in the Debugger?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform