Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shellexecute Twice For A PDF ?

Status
Not open for further replies.

adamwill

Programmer
Jun 19, 2003
18
GB
We have a form in our VFP8 app which we use for launching PDF's via shellexec. For some reason (on some machines) we have to click twice for the PDF to appear. After the first click the PDF does not appear on screen (though it can be seen in task manager), after the second click it appears. This might not seem a huge issue - but our customers are less than happy.

Does anyone have an idea of any settings which might be the culprit?
 
adamwill

Can you post the line of code you are using for ShellExcete? What parameters are you using?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin

lcFile = alltrim(stock_details.spec)

if not emptyornull(lcFile)
if FileExists(lcFile)
wait window 'Loading Stock Specication '+lcFile nowait
lcTest=ShellExecute(0,"Open",lcFile,"","",3)
if lcTest<32
messagebox('Failed to open '+lcFile,48,'Error')
endif
else
messagebox('File Does Not Exist',48,'Error')
endif
endif
 
I tried the code suggestion and it had the same problem. I have however disovered that the only machines it seems to work on are running acro reader V4 and not V6. So as long as the documents are compatible that is a sort of solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top