Vince Teachout wrote:
> We've used a function FOREVER that runs a ShellExec passing as a parm 
> the name of an FDF (Adobe Format descriptor file) that then opens a PDF.
> We've never had problems with it until recently.
> 
> On this new install, all 5 machines don't do anything when we ShellExec 
> passing OPEN (or NULL) and the FDF filename.  Shellexec returns code 31, 
> which means no associated app.  However, clicking directly on the FDF 
> file works fine, opening the associated Adobe Reader.

For whatever reason, the shellexec routine I posted in the original 
message doesn't work on all machines.  I fixed it by doing this:

First, called FindExecutable to get the name of the program associated 
with that extension (FDF, in this case):

DECLARE INTEGER FindExecutable IN shell32;
     STRING lpFile, STRING lpDir, STRING @lpResult

lcDefaultApp = SPACE(250)

IF FindExecutable (cfile, "", @lcDefaultApp) > 32
     lcDefaultApp = ALLTRIM(STRTRAN(lcDefaultApp, Chr(0), " "))
ELSE
     *  handle error codes...
ENDIF


Shellexec takes these parms:
Shellexec( WinHandle, Operation, filename, parms, start dir, showcmd)

Instead of calling like this:
Shellexec(0,"OPEN","c:\myfile.fdf","","",1)

I called it like this, passing the default app from above as the file 
name, and my file as the parm:

Shellexec(0,"OPEN",lcDefaultApp,"c:\myfile.fdf","",1)

Worked like a charm.  Thanks, me!


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to