Autor Beitrag
Lucky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84

XP
Delphi 7
BeitragVerfasst: Fr 09.02.07 09:57 
Hallo,
hätte da ne Frage nämlich ich ruf von einem Programm ein anderes auf u. möchte nun dabei eine Variable übergeben wie mache ich das? Vielen Dank schon mal.
Hab bis jetzt
ShellExecute(Application.Handle,'Open','Lagerverwaltung.exe ','Computername','\\sqlsrv\srvdsk\EDV\Lagerverwaltung\',
sw_show);
und der computername müsste ne variable sein, soll also z.B. EDVTEST drinnen stehen
Bitte helft mir


Moderiert von user profile iconGausi: Topic aus Sonstiges (Delphi) verschoben am Fr 09.02.2007 um 10:23
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Fr 09.02.07 10:09 
Du übergibst das als Parameter und das Programm muss dann natürlich in der Lage sein, diesen Parameter auszuwerten. Wenn "Lagerverwaltung.exe" von Dir ist, musst Du das ein wenig anpassen. Siehe dazu in der Delphi-Hilfe unter "ParamStr", wenn ich mich richtig erinnere.
Lucky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84

XP
Delphi 7
BeitragVerfasst: Fr 09.02.07 11:05 
Ja die Übergabe funktioniert aber wie mache ich das er bei shellexecute ne variable übergibt u. nicht den String Computername?
In der Hilfe steht leider nichts nützliches drinnen
basti_1984
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 104

Linux, Win Xp, Win 2000
Delphi, C, C++, PHP,
BeitragVerfasst: Fr 09.02.07 11:11 
Hallo so müsste s eingentzlich funktionieren:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var 
 test:String;
begin
test:='Irgendetwas';
ShellExecute(Application.Handle,'Open','Lagerverwaltung.exe ',test,'\\sqlsrv\srvdsk\EDV\Lagerverwaltung\',
sw_show);

_________________
Wissen ist Macht. Nichts zu Wissen macht auch nichts
Lucky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84

XP
Delphi 7
BeitragVerfasst: Fr 09.02.07 11:16 
Ne hab ich auch schon probiert da bringt er den Fehler:
[Fehler] Kennwort.pas(123): Inkompatible Typen: 'String' und 'PAnsiChar'
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 09.02.07 11:18 
Na, dann eben so ;-):
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var 
 test:String;
begin
test:='Irgendetwas';
ShellExecute(Application.Handle,'Open','Lagerverwaltung.exe ',PChar(test),'\\sqlsrv\srvdsk\EDV\Lagerverwaltung\',
sw_show);

_________________
We are, we were and will not be.
Lucky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84

XP
Delphi 7
BeitragVerfasst: Fr 09.02.07 11:21 
Ja jetzt klaptts vielen Dank, *mist*e da hätte ich selber drauf kommen müssen. Nochmals vielen vielen Dank