Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 06.03.09 13:10 
Moin Forum,

ich möchte DLL´s zur Laufzeit mittels DCC32 kompilieren. Das klappt auch.
Aber was, wenn beim Compilieren ein Fehler auftritt? Da ich DCC32 von meiner GUI aus aufrufe verwschwindet es sofort wieder nach Abarbeitung. Kann ich das schwarze Fensterchen im Falle eines Fehlers irgendwie dazu bringen offen zu bleiben?

Danke im voraus
Oliver

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 06.03.09 13:21 
Du kannst die Ausgabe entweder in eine Logdatei umleiten (dcc32 ... > xy.txt, bzw. mit >> um an die Datei anzuhängen), oder du fängst die Ausgabe direkt in deinem Delphiprogramm ein:
www.delphi-forum.de/....php?p=105508#105508
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4808
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Fr 06.03.09 13:22 
Du könntest mittels "start DCC32 ..." den Compiler aufrufen, dann bleibt das Fenster erhalten (bis der Anwender es explizit schließt).
Wenn du auch noch auf das Ende warten willst, d.h. synchron den Compiler aufrufen möchtest, dann einfach noch "/WAIT" als Parameter hinzufügen (s. a. "start /?").

Wenn du jedoch nur im Fehlerfalle das Fenster offen haben willst, dann schreib dir am besten eine Batch-Datei, welche den Status von "DCC32" abfragt und nur im Erfolgsfall "exit" aufruft (leider bin ich nicht der DOS Batch-Experte, um dir genaueres zu sagen).
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 06.03.09 13:33 
Wenn der dcc den Exitcode entsprechend setzt, dann wäre eine einfache Abfrage via Errorlevel in der Batch möglich, ich müsste aber erstmal ausprobieren ob der das überhaupt tut.

Außerdem ist die Frage, ob wirklich das Fenster offen bleiben soll oder nicht lieber eine Auswertung im Delphiprogramm sinnvoller wäre. Wenn das Fenster im Fehlerfall offen bleiben soll, dann könnte ich kurz schauen, ob der Exitcode gesetzt wird, der entsprechende Batchcode dazu ist simpel.
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 06.03.09 13:51 
@Jaenicke: Danke, ich probiere das mal aus. Auswerten im Delphi-Programm ist auf jeden Fall besser.

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 06.03.09 14:00 
Ist an dem Aufruf etwas falsch?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm1.Button4Click(Sender: TObject);
var output  :TStringList;
    errors  :TStringList;
    Dir     :String;
    s       :String;
begin
  Dir := ExtractFilePath(ParamStr(0));

  output:=TStringList.Create;
  try
    errors:=TStringList.Create;
    s := 'cmd ' + Dir + 'dcc32.exe mydll';
    if GetConsoleOutput(s, output, errors) then
      Memo1.Lines.AddStrings(output);
      Memo1.Lines.AddStrings(errors);
  finally
    output.free;
    errors.free;
  end;

end;



Irgendwie habe ich in der Ausgabe immer nur
ausblenden Quelltext
1:
2:
3:
4:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Dokumente und Einstellungen\Oliver>

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 06.03.09 14:08 
:oops:
Das "cmd" mußte weg, jetzt gehts :)

Danke Euch

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 06.03.09 14:14 
Nebenbei interessiert dich vielleicht auch mein Delphi Batch Compiler:
www.delphi-forum.de/viewtopic.php?t=41748
Das Tool kompiliert Projekte aus einer Batchdatei und liest dafür die Suchpfade aus der Registry aus, bei mehreren installierten Delphiversionen kann auch ein bestimmter Compiler benutzt werden.