Autor Beitrag
Steffen2412
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 18.08.05 12:03 
Hallo ich habe folgende Methode:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.ExportTables;
var
  path : string;
  parameters : string;
begin

  path := orahome + '\bin\exp.exe';
  parameters := 'prophetmaster/' + mEditPWProphet.Text
              + '@' + mCBDatenbank.Text
              + ' file=' + ExtractShortPathName(mEditExpverz.Text) + '\exp.dmp'
              + ' parfile=' + ExtractShortPathName(GetCurrentDir) + '\exp.par';

  ShellExecute(0'open', PChar(path), PChar(parameters), nil0);

end;


Was muss ich an dem Code ändern, damit solagne gewartet wird bis das Programm ausgeführt wurde?
Und ist es möglich mitzubekommen ob das Programm fehlerfrei abgelaufen ist, oder ob ein Fehler aufgetreten ist?


Steffen

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 18.08.05 12:21 

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Steffen2412 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 18.08.05 13:56 
Kann ich sowas nur mit CreateProcess machen oder geht das auch mit Shell Execute?
Wenn nur mit CreateProcess, wie kann ich dort Parameter übergeben und wie kann ich
den Rückgabewert des Programms abfangen?


Steffen
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 18.08.05 14:46 
Suche im MSDN CREATEPROCESS. Dort steht alles erklärt.
drstar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 79
Erhaltene Danke: 2

Windows 8.1/x64
Delphi 10.1
BeitragVerfasst: Fr 19.08.05 16:59 
www.coding-board.de/...howthread.php?t=4119 hier findest Du eine Routine (ShellExecAndWait),dürfte nach Deinem Geschmack sein...