ShellExecute not working properly

From: Anchorman (JesseN0SPAM_at_davinci-mims.com)
Date: 10/30/03


Date: Thu, 30 Oct 2003 08:14:34 -0500

I have the following simple function:

procedure TMainFrm.ViewFile(const cFileName : String);
Begin
   ShellExecute(Handle,'open',pChar(cFileName), NIL,NIL,SW_SHOW);
end;

cFileName contains both the path and file name to execute. I know that the
path and file name are valid, because I can copy the contents of this
variable to the clip board (while in the delphi debugger), and paste it in
the Run command in Windows, press Enter, and it properly brings up Acrobat,
and loads the file.

What is happening here is that this function will bring up Acrobat, then
Acrobat appears to exit before it loads or displays the file.

I've tried supplying the path where the file is in the parameter for that in
ShellExecute, and I've also tried various other SW_* settings, but nothing
seems to make a difference.

I'm using Delphi, and currently running on Windows 2000, but this app will
be deployed to all sorts of Windows versions.

Thanks,
Jesse
www.davinci-mims.com



Relevant Pages

  • Re: ShellExecute not working properly
    ... > cFileName contains both the path and file name to execute. ... > the Run command in Windows, press Enter, and it properly brings up Acrobat, ... > Acrobat appears to exit before it loads or displays the file. ...
    (borland.public.delphi.language.objectpascal)
  • Re: proper way to uninstall fonts?
    ... PC" suggests uninstalling some fonts. ... Windows XP only loads fonts as needed. ... that's why Photoshop and Acrobat take so long to load! ...
    (microsoft.public.word.printingfonts)
  • Re: word 2003 wont load in windows mode
    ... causes are a damaged normal.dot template, a problem with the printer driver for the default printer in Windows, or an add-in to Word. ... You don't have Acrobat 5, but you do have Acrobat 8, and Acrobat does install an add-in to Word, and 8.0 is not the updated version of Acrobat. ... It gives me no error code or error information but I keep sending the error report but it's still not fixed. ...
    (microsoft.public.office.misc)
  • Re: IE closes when trying to link to a page with a PDF file
    ... Allow active content to run in files on My Computer - Windows XP Service ... Try opening Acrobat reader before opeing the links. ... regsvr32 Actxprxy.dll ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: IE Browser Add-ons
    ... Ramesh, Windows XP MVP ... crash IE (yet neither crashes if you allow acrobat to open as a standalone ... first crash with IE on this machine. ... I assume this came with the Google Toolbar I downloaded last night. ...
    (microsoft.public.windowsxp.help_and_support)