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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -