Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: PChar to PAnsiChar


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jun 10, 2015 1:27 AM Last Post By: Patrick Schwarzer
Hubert Anemaat

Posts: 9
Registered: 9/26/02
PChar to PAnsiChar  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 10, 2015 1:17 AM
Hello,

I have the following code in Delphi 2007:

WinExec( PChar( 'Notepad ' + TextFile), SW_SHOW);

In Delphi XE8 I get the hint PAnsiChar.
So I changed it to:

WinExec( PAnsiChar( 'Notepad ' + TextFile), SW_SHOW);

But then the compiler gives the warning: W1044 suspicious typecast of string to PAnsiChar.

How can this be solved ?

Thanks,
Hubert
Patrick Schwarzer

Posts: 17
Registered: 1/15/04
Re: PChar to PAnsiChar  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 10, 2015 1:27 AM   in response to: Hubert Anemaat in response to: Hubert Anemaat
WinExec( PAnsiChar( 'Notepad ' + AnsiString(TextFile)), SW_SHOW);

--
Patrick Schwarzer
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02