Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: dcNiko Vujke
  Where is dcNiko Vujke?
 Belgrade
 Serbia
 dcNiko Vujke
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: ShellExecute returns code 31
Thread ID: 259592 Message ID: 259609 # Views: 27 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Win32API programming
Date: Wednesday, April 21, 2010 10:50:02 AM         
   


Hi Stefan,
thanks for a quick response. I don't have regedit rights so is there any other way to associate printing of pdf files with certain application. I work on Windows XP SP2.

> Hi Niko,
>
> ShellExecute() returning Error 31 means "There is no application associated with the given file-name extension."
>
> > PDF files are associated with Acrobat Reader 5.0 in Explorer-->Tool-->Folder Options-->File Types.
> >
>
> You can see the associated commands for a given extension in Registry, where "open" and "print" might have different parameter strings content, and in your case perhaps "print" might not be associated at all in your particular setup?
>
>
>
> hth
> -Stefan
>
>
> > Hi fox(f)i(gh)ter's,
> > in the code bellow ShellExecute returns to value 31 wich means 'There is no application associated with the given filename extension.'
> >
> >
> > DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER lnHWnd,STRING lcAction,STRING lcFileName,STRING lcExeParams,STRING lcDefDir,INTEGER lnShowWindow
> > 
> > lcPath="C:\PROGRAM FILES\ADOBE\ACROBAT 5.0\READER\ACRORD32.EXE"
> > afile="C:\PDFFile.PDF"
> > ShellExecute(0,"Print",lcPath,afile,"",1)
> > 

> >
> > Does anyone know what the problem is about. When I put Open as command:
> >
> > ShellExecute(0,"Open",lcPath,afile,"",1)
> >
> > file is opening without problems. Also other types of files (like word,excel etc.) are printing with same command without problems. PDF files are associated with Acrobat Reader 5.0 in Explorer-->Tool-->Folder Options-->File Types.

COMPLETE THREAD

ShellExecute returns code 31 Posted by dcNiko Vujke @ 4/21/2010 9:51:50 AM
RE: ShellExecute returns code 31 Posted by Stefan Wuebbe @ 4/21/2010 10:06:45 AM
RE: ShellExecute returns code 31 Posted by dcNiko Vujke @ 4/21/2010 10:50:02 AM
RE: ShellExecute returns code 31 Posted by Stefan Wuebbe @ 4/21/2010 11:16:44 AM