Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File 'shellexecute.prg' does not exist
Message
De
03/11/2022 08:34:34
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01685206
Message ID:
01685208
Vues:
45
>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
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform