Problem with shellexecute and Delphi XE

The following code worked fine in Delphi 2010.  I recently moved to Delphi XE. I am attempting to launch another application from within a Delphi app.

      if ShellExecute(0, nil, PChar('c:\temp\newapp.exe), nil, nil, SW_SHOW) <= 32 then
           Application.MessageBox('Couldn''t execute the application',
                                  'Error', MB_ICONEXCLAMATION);

This will return an error that says"The program or feature "\??\c:\temp\newapp.exe" cannot start or run due to incompatibility with 64 bit version of Windows.

The error message comes up because the PChar typecast is placing "\??\" in front of the string "c:\temp\newapp.exe".

I believe it may be something in Delphi XE that I must turn off or turn on, but I have no idea.

I can duplicate this problem in a simple app everytime using ShellExecute.  

Who can help me?  I am running a 64-bit machine with Windows 7.

Thanks
Lee Mc Cauley
 
profitsourceAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ThommyCommented:
You have forgotten the second inverted comma for your app string...

ShellExecute(0, nil, PChar('c:\temp\newapp.exe'), nil, nil, SW_SHOW) <= 32 then
0
profitsourceAuthor Commented:
I don't see how your answer has anything to do with the problem I am having.

Besides, one of the links you sent me was in German.

Lee
0
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

profitsourceAuthor Commented:
Thommy;

My previous comment was for systan.

That was a typo on my part when submitting this question.  In my app, it is there.

If I would not have it in my app, it wouldn't even compile. So that is not the issue.

Lee
0
systanCommented:
I'm not German, sorry for the link, but I think you have the idea now, to wOwdisable if executing 32b from 64b app.

I know you understand the function.
0
profitsourceAuthor Commented:
Problem has been solved.  I am sorry for wasting anyone's time. The problem was with a corrupted file that I was attempted to execute.

Thank you,
Lee
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
systanCommented:
yee
good that you replaced
from
if ShellExecute(0, OPEN,
to
if ShellExecute(0, nil,

oh
corrupted file?
that's the number one reason the file would not ran
0
mlmccCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.