Autor Beitrag
Xadron
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Sa 24.11.07 21:11 
Ich habe ein kleines aber für mich recht großes Problem.
Ich möchte eine EXE ausführen, aber es gibt das problem beim compilieren:
inkompatible typen string und pansichar.

Der Code lautet:
ShellExecute(Handle, nil, (pfad), nil, nil, SW_SHOW);

davor wurde aber "pfad" bezeichnet mit:
pfad:=ExtractFilePath(ParamStr(0))+'alarm1280.exe';
und das als:
pfad:string;

Wie muss es genau lauten, damit es funktioniert?

StrToChar ?

_________________
|x-32:88x+39-3|+3:21=47-4x
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Sa 24.11.07 21:14 
ausblenden Delphi-Quelltext
1:
PChar(pfad);					


Gruß
Xadron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Sa 24.11.07 21:18 
Danke geht auch, aber startet exe nicht.
Die exe ist im gleichen ordner wie das programm, was ich mache:

pfad:=ExtractFilePath(ParamStr(0))+'alarm1280.exe';

(alarm1280.exe soll gestartet werden und ist im gleichem ordner)

_________________
|x-32:88x+39-3|+3:21=47-4x
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 24.11.07 21:21 
Sollte eigentlich so gehen. wie startest du die andere exe. (ShellExecute?) Rückgabewert?

_________________
Markus Kinzler.
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Sa 24.11.07 21:23 
Hi,

hatte mir den ShellExecute- Befehl garnicht genau angeschaut. Probier's mal so:

ausblenden Delphi-Quelltext
1:
ShellExecute(Handle, 'open', PChar(pfad), nilnil, SW_NORMAL);					


edit: Markus hat aber recht, sollte auch so funktionieren.

Gruß


Zuletzt bearbeitet von Saubäär am Sa 24.11.07 21:26, insgesamt 1-mal bearbeitet
Xadron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Sa 24.11.07 21:24 
danke




Gruß

_________________
|x-32:88x+39-3|+3:21=47-4x