Cast the string as a Pchar :
WinExec(PCHAR(drive + 'apps\myapps\setup.exe'), SW_SHOWNORMAL);
Incidently, if 'apps\myapps\setup.exe' is always going to be the same it
would be probably better to define it as a constant somewhere. If it is a
global path, create a file called global.pas with
Const
SetupPath = 'apps\myapps\setup.exe';
And use
WinExec (PCHAR(drive + SetupPath), SW_SHOWNORMAL);
Or if you don't want to do that define it in the current unit just above the
type declaration.
It just saves time later on if you change the path for some reason. You only
have to change one line of code, instead of potentially heaps.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 4 September 2001 11:02
To: Multiple recipients of list delphi
Subject: [DUG]: incompatible types
with this piece od code i get incompatible types pchar and strings
if ComboBox1.ItemIndex= 0 then WinExec(drive+'apps\myapps\setup.exe',
SW_ShowNormal);
...
Brendon Toogood
E-Mail [EMAIL PROTECTED]
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/