We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


procedure ShellExecute called in IDE locks app and IDE

formi asked
Medium Priority
Last Modified: 2013-12-03
if I call "ShellExecute" within the IDE (meaning debugging my application) I often (not always) get an "external exception EEFFACE" and the application and the IDE are locked. I have to kill Delphi7-process. Starting the application without IDE this problem newer occurs.

Any idea where the problem is or how I can call the external application not using ShellExecute?

Thanks in advance, Peter
ShellExecute(0, 'open', StrPCopy(zFileName, 'http://SiteToBeCalled'), '','', SW_SHOWMAXIMIZED);

Open in new window

Watch Question

I'm not sure the conversion you use is memory safe (because it does not perform any length checking - http://www.freepascal.org/docs-html/rtl/strings/strpcopy.html).

Better use the PChar() conversion routine like this:
ShellExecute(0, 'open', PChar(zFileName), '','', SW_SHOWMAXIMIZED);
or simply input the text as string constant:
ShellExecute(0, 'open', 'http://SiteToBeCalled', '','', SW_SHOWMAXIMIZED);

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
I would recommend:
ShellExecute(Handle, 'open', PChar('http://SiteToBeCalled'), nil,nil, SW_SHOWMAXIMIZED);
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.