Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8845347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:43:02+00:00 2026-06-14T11:43:02+00:00

I have an application that’s compiled using Delphi 2006, and I want to launch

  • 0

I have an application that’s compiled using Delphi 2006, and I want to launch an another application compiled in XE2 and pass it a parameter. I am using ShellExecute to launch the 2nd app from D2006, and the 4th parameter in ShellExecute expects PANSIChar (as the parameter passed to the launched application).

My XE2 app is not reading the parameter correctly, presumably due to the change to UNICODE strings.

Is there a way I can launch my XE2 application from my D2006 application and pass it the string as a parameter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:43:03+00:00Added an answer on June 14, 2026 at 11:43 am

    Your Delphi 2006 program is calling the ANSI version of ShellExecute, namely ShellExecuteA. That receives ANSI parameters.

    When those arguments arrive in your Delphi XE2 program, they will be retrieved via GetCommandLine. And XE2 programs will call the Unicode version, GetCommandLineW.

    But behind the scenes, Windows will have converted from ANSI to Unicode for you.

    This sort of context sensitive conversion happens all the time in Windows. For example, you call SendMessageA, for WM_SETTEXT, passing a PAnsiChar. But the window is a Unicode window and so receives a PWideChar. The system has to be this way. Anything else would be anarchy.

    The source of your problem is not that one program uses ANSI, and the other Unicode. Your problem is elsewhere.

    Where exactly, it’s impossible to tell with this information. One obvious possibility is that your argument contains spaces. Those spaces are interpreted as argument separators by the recipient, the XE2 program. Wrap your arguments in quote marks. Like this:

    ShellExecute(..., '"argument with spaces"', ...);
    

    Another possibility is that you are perhaps casting the argument to PAnsiChar when you receive it. If so, don’t. Just read ParamStr(1) which is a Unicode string. Converted from ANSI for you by Windows.

    I’m clearly guessing a little at the end here, but there’s frankly not enough information to diagnose the fault definitively. But I can be sure that ANSI text is transparently converted to Unicode in your scenario.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a application that runs very well on JBoss using JSF 2. I
I have an application that has two buttons, and I want to detect when
I have an application that allows, using an abstract class, people to write their
I have network application that handles about 40k msg/sec written using netty framework and
I have application that have button i want when click this button every 1
I have an application that I want to use Visual Styles and I have
I have application that works using Perl's CGI::Fast . Basically mainloop of the code
I have an application that uses an aps:GridView. The GridView is populated using a
I have application that searchs External storage for the file i want..Example for song
I have application that makes different queries with different results so the caching in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.