Cmd String to PAnsiChar in delphi -
i relatively new delphi , want make quick application uses shellexecute
command.
i want use string values in edit boxes add command line doing processing job outside of application.
everything works fine, error :
"incompatible types: string , pansichar"
i have tried convert using: variable := pansichar(ansistring(editbox.text)
, no avail.
can assist me problem please.
in delphi 7, it's simple typecast pchar
, pansichar
:
pchar(yourstringvariable);
or
pchar('some text here'); // cast not needed; demonstration pchar('c:\' + afilename); // cast needed because of variable use
using shellexecute
:
afile := 'c:\mydir\readme.txt'; res := shellexecute(0, 'open', pchar(afile), nil, nil, sw_normal )
Comments
Post a Comment