Incompatible types: 'string' and 'PAnsiChar' PLEASE HELP! 300pts

Hi,

how to i fix this?

i have a variable 'IPAddress' which is a string which i would like to use as follows:

   WinExec('mstsc /v ' + IPAddress + ' /f',sw_ShowNormal);

but i get the following error ---> Incompatible types: 'string' and 'PAnsiChar'.

I think i need to use a pointer or typecast but i think i feel asleep in the lecture at that stage!

many thanks
naresh.
LVL 1
pate60Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Russell LibbyConnect With a Mentor Software Engineer, Advisory Commented:

WinExec(PChar('mstsc /v ' + IPAddress + ' /f'),sw_ShowNormal);

Regards,
Russell
0
 
pate60Author Commented:
Cheers Russell!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.