This works fine, but how can I replace the string of the file to execute by my string.
I have:
Var
txt : string;
.
.
txt := 'myprogram.exe'
.
.
ShellExecute(Handle, 'open', txt, nil, nil, SW_SHOWNORMAL);
This gives a compile error:
Incompatible types: 'String' and 'PAnsiChar'
How can I conver my string to PAnsiChar?
AKJo
Junior Poster in Training
59 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
You can convert it like any other conversion with pansichar(txt) or, you could have made the variable an ansichar and sent the pointer..
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190