• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 640
  • Last Modified:

New to Delphi XE2 from Delphi 7 - STUCK

For over 10 years I have been using the ExecuteFile function from the fmxUtils unit.  Upon switching to Delphi XE2, I no longer seem to have that available to me.   WinExec does not work.  CreateProcess gives access violation.  What do I have to do to execute a program? This was something that was always simple to do. Now suddenly it seems rather tricky.  Perhaps it's something in the ASCII to Unicode conversion as all winapi calls seem to be PWideChar instead of PChar.
0
steinonline
Asked:
steinonline
  • 6
  • 2
1 Solution
 
MerijnBSr. Software EngineerCommented:
ExecuteFile was a simple wrapper around ShellExecute()

Please see here some examples on how to use ShellExecute() yourself: http://tekreaders.com/blog/2011/08/03/shellexecute-in-delphi-launch-external-applications/
0
 
steinonlineAuthor Commented:
I know how to use ShellExecute.  Could you please tell me what unit I might need to use for it to be available.  I am already using winapi.windows unit and ShellExecute is not declared there.
0
 
steinonlineAuthor Commented:
I feel silly even asking the question, but I've spent more time trying to run an external program that I've spent writing the rest of the program, and the documentation with XE2 is horrible at best.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
MerijnBSr. Software EngineerCommented:
It's in the unit Winapi.ShellApi
0
 
steinonlineAuthor Commented:
A+ for timely response.
0
 
steinonlineAuthor Commented:
thanks for the quick reply.  Felt like an idiot even asking the question.  
Easiest 200 ever.  

Thanks much friend!
0
 
Geert GruwezOracle dbaCommented:
Easiest ?
I'd relate that to experience of having the same problem in the past and MerijnB being so nice as sharing it
0
 
steinonlineAuthor Commented:
much appreciated regardless!!!
0
 
steinonlineAuthor Commented:
Geert, I relate it to you don't need to correct my thank you to MerijnB.  Not sure why you felt the need to speak up about that, since you offered no assistance on my question.  I don't think your condescending comment was at all necessary.  It was humiliating enough to even ask the question.  I don't need for you to rub it in for the sake of making yourself feel better.  I kinda figured that whoever answered the question would have known the answer by previous experience.  Nobody and I mean nobody knows everything.  Everybody is capable of a brain fart once in a while.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now