Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot View PDF with ShellExecute
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01554652
Message ID:
01554868
Vues:
75
Ok, put in the error checking and the return value is
"There is no application associated with the given filename extension."

However, if the user uses Windows Explorer and clicks on the file, it ipens up fine
I would have thought that if there was no application associated, the file would not open in Explorer either ??
Regards,
Gerard


>Every value greater that 32 means that ShellExecute is successful.
>If the returned value is smaller or equal than 32 then something is not right.
>Here some code for checking (taken from here http://www.oehive.org/node/528):
>
>LOCAL txt
>lnRetVal = ShellExecute(...)
>DO CASE 
>   CASE lnRetVal = 0 
>        txt = "The operating system is out of memory or resources."
>   CASE lnRetVal = 2 
>        txt = "The specified file was not found"
>   CASE lnRetVal = 3 
>        txt = "The specified path was not found."
>   CASE lnRetVal = 5 
>        txt = "Windows 95 only: The operating system denied access to the specified file"
>   CASE lnRetVal = 8 
>        txt = "Windows 95 only: There was not enough memory to complete the operation."
>   CASE lnRetVal = 10 
>        txt = "Wrong Windows version"
>   CASE lnRetVal = 11
>        txt = "The .EXE file is invalid (non-Win32 .EXE or error in .EXE image)."
>   CASE lnRetVal = 12
>        txt = "Application was designed for a different operating system"
>   CASE lnRetVal = 13
>        txt = "Application was designed for MS-DOS 4.0"
>   CASE lnRetVal = 15
>        txt = "Attempt to load a real-mode program"
>   CASE lnRetVal = 16
>        txt = "Attempt to load a second instance of an application with non-readonly data segments".
>   CASE lnRetVal = 19
>        txt = "Attempt to load a compressed application file"
>   CASE lnRetVal = 20
>        txt = "Dynamic-link library (DLL) file failure"
>   CASE lnRetVal = 26
>        txt = "A sharing violation occurred."
>   CASE lnRetVal = 27
>        txt = "The filename association is incomplete or invalid."
>   CASE lnRetVal = 28
>        txt = "The DDE transaction could not be completed because the request timed out."
>   CASE lnRetVal = 29 
>        txt = "The DDE transaction failed."
>   CASE lnRetVal = 30 
>        txt = "The DDE transaction could not be completed because other DDE transactions were being processed."
>   CASE lnRetVal = 31 
>        txt = "There is no application associated with the given filename extension."
>   CASE lnRetVal = 32
>        txt = "Windows 95 only: The specified dynamic-link library was not found."
>   CASE lnRetVal > 0
>        txt = "Undocumented"
>ENDCASE
>
>IF NOT EMPTY(txt)
>   MessageBox( txt)
>ENDIF
>
>
>
>>Hi Boris. Thanks for replying.
>>I will have to recompile, deploy on site, and then I can figure this out
>>What should it be for a successful display ?
>>Only want to Wait Window if its not successful
>>Regards,
>>Gerard
>>
>>
>>>>Hi.
>>>>Have the code below to view a PDF file, but file is not displaying on a new PC added to a network.
>>>>All others can see the PDF file
>>>>Also, if user goes in in Windows Explorer, PDF file comes up if user clicks on it, so Adobe seems to be installed ok
>>>>Any ideas ?
>>>>Tia
>>>>Gerard
>>>>
>>>>
>>>>&& -----------------------------------------------------------------
>>>>&& Show the PDF file
>>>>DECLARE Integer ShellExecute IN "Shell32.dll" ;
>>>>    INTEGER hwnd, ;
>>>>    STRING lpVerb, ;
>>>>    STRING lpFILE, ;
>>>>    STRING lpParameters ,;
>>>>    STRING lpDirectory, ;
>>>>    LONG nShowCmd
>>>>lcPDFFile = lcPdf
>>>>=Shellexecute(0,"Open",lcPdfFile,"","",3)
>>>>&& -----------------------------------------------------------------
>>>>
>>>
>>>What is the return value of ShellExecute?
>>>
>>>lnRetVal =Shellexecute(0,"Open",lcPdfFile,"","",3)
>>>WAIT WINDOW lnRetVal
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform