Solved

New to Delphi XE2 from Delphi 7 - STUCK

Posted on 2014-01-15
9
582 Views
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.
0
Comment
Question by:steinonline
  • 6
  • 2
9 Comments
 
LVL 19

Expert Comment

by:MerijnB
ID: 39782094
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
 

Author Comment

by:steinonline
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 winapi.windows unit and ShellExecute is not declared there.
0
 

Author Comment

by:steinonline
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.
0
 
LVL 19

Accepted Solution

by:
MerijnB earned 200 total points
ID: 39782110
It's in the unit Winapi.ShellApi
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Closing Comment

by:steinonline
ID: 39782122
A+ for timely response.
0
 

Author Comment

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

Thanks much friend!
0
 
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
0
 

Author Comment

by:steinonline
ID: 39803069
much appreciated regardless!!!
0
 

Author Comment

by:steinonline
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
firstChar challenge 13 110
python question 5 69
Export Table to CSV - Access to CSV - using python 18 100
Convert MS Word document to a PDF file 9 64
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now