New to Delphi XE2 from Delphi 7 - STUCK

Posted on 2014-01-15
Last Modified: 2014-01-23
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.
Question by:steinonline
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
LVL 19

Expert Comment

ID: 39782094
ExecuteFile was a simple wrapper around ShellExecute()

Please see here some examples on how to use ShellExecute() yourself:

Author Comment

ID: 39782102
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 unit and ShellExecute is not declared there.

Author Comment

ID: 39782107
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.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 19

Accepted Solution

MerijnB earned 200 total points
ID: 39782110
It's in the unit Winapi.ShellApi

Author Closing Comment

ID: 39782122
A+ for timely response.

Author Comment

ID: 39782124
thanks for the quick reply.  Felt like an idiot even asking the question.  
Easiest 200 ever.  

Thanks much friend!
LVL 37

Expert Comment

by:Geert Gruwez
ID: 39784671
Easiest ?
I'd relate that to experience of having the same problem in the past and MerijnB being so nice as sharing it

Author Comment

ID: 39803069
much appreciated regardless!!!

Author Comment

ID: 39803102
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.

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi Yen format 3 59
Slow Restore if incremental backups using RDiff.exe 4 39
How to Have Macro Files Automatically "Edit" 5 46
Create .bat File 16 71
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this post we will learn different types of Android Layout and some basics of an Android App.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question