Autor Beitrag
pfeiffe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 35



BeitragVerfasst: So 08.02.04 20:28 
Wenn ich z. B. eine externe Konsolenanwendung von meinem Programm aus mit CreateProcess starte, kann ich dann auch z. b. den in der Konsoleanwendung ausgegebenen Text in meiner Anwendung anzeigen lassen?
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mo 09.02.04 07:56 
Meinst du mit Consolenprogramm die Eingabeaufforderung (DOS-Box)?

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
pfeiffe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 35



BeitragVerfasst: Mo 09.02.04 10:42 
Ja, die meine ich (wobei die DOS-Box unter WinXP eine 32Bit Anwendung ist).
Nehmen wir als Beispiel diesmal den Compiler von Delphi (dcc32.exe). Wenn ich diesen mit dem Parameter -help öffne, so werden alle Parameter aufgelistet. Ich möchte nun aber, dass diese Parameter in meiner Anwendung aufgelistet werden. Geht das?
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Mo 09.02.04 11:25 
Hallo,

die Switzer wissen wie des geht (klick).

Gruß
Ken

_________________
Eine Klasse beschreibt die Struktur und das Verhalten einer Menge gleichartiger Objekte.
pfeiffe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 35



BeitragVerfasst: Mo 09.02.04 11:41 
Ich verstehe den Parameter "InputFile" nicht ganz. Wozu ist der gut?:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
{----------------------------CreateDOSProcessRedirected--------------------------- 
 Description    : executes a (DOS!) app defined in the CommandLine parameter redirected 
                  to take input from InputFile and give output to OutputFile 
 Result         : True on success 
 Parameters     : 
                  CommandLine : the command line for the app, including its full path 
                  InputFile   : the ascii file where from the app takes input 
                  OutputFile  : the ascii file to which the app's output is redirected 
                  ErrMsg      : additional error message string. Can be empty 
 Error checking : YES 
 Target         : Delphi 2, 3, 4 
 Author         : Theodoros Bebekis, email bebekis@otenet.gr 
 Notes          : 
 Example call   : CreateDOSProcessRedirected('C:\MyDOSApp.exe', 
                                             'C:\InputPut.txt', 
                                             'C:\OutPut.txt', 
                                             'Please, record this message') 
-----------------------------------------------------------------------------------}
 

function CreateDOSProcessRedirected(const CommandLine, InputFile, OutputFile, 
  ErrMsg: string): Boolean;
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Mo 09.02.04 11:51 
hallo,

der parameter inputfile sind die kommandozeilen-parameter, die du dem programm übergibst.

Gruß
Ken

_________________
Eine Klasse beschreibt die Struktur und das Verhalten einer Menge gleichartiger Objekte.
pfeiffe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 35



BeitragVerfasst: Mo 09.02.04 12:33 
Irgendwie klappt das nicht so ganz wie es sollte. Kann mir da mal jemand helfen?
Oder gibt es noch eine andere Möglichkeit um den Text einer Konsolenanwendung auszulensen?
Wie macht das eigentlich Delphi? Die Fehlermeldungen werden ja dann auch in der IDE angezeigt. Oder werden diese Fehlermeldungen garnicht im Debugger erzeugt?
pfeiffe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 35



BeitragVerfasst: Mo 09.02.04 15:57 
CenBells hat folgendes geschrieben:
hallo,

der parameter inputfile sind die kommandozeilen-parameter, die du dem programm übergibst.

Gruß
Ken


Könnte jemand ein Beispiel dazu geben?
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 09.02.04 16:09 
pfeiffe hat folgendes geschrieben:
Irgendwie klappt das nicht so ganz wie es sollte. Kann mir da mal jemand helfen?
Oder gibt es noch eine andere Möglichkeit um den Text einer Konsolenanwendung auszulensen?

Versuch doch lieber mal das Problem genauer zu beschreiben anstatt gleich nach einer anderen Möglichkeit zu fragen.

Gruß
Tino
pfeiffe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 35



BeitragVerfasst: Mo 09.02.04 16:27 
Mein Problem ist eben, ich weiss nich was ich genau in die InputFile schreiben muss.
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Di 10.02.04 08:37 
Zitat:
ausblenden Delphi-Quelltext
1:
2:
{Example call:}
 CreateDOSProcessRedirected('C:\MyDOSApp.exe',  'C:\InputPut.txt',  'C:\OutPut.txt',  'Please, record this message')


ich neheme an das in die input, die befehle die du in die Dos-Box eingeben würdest hinmüssen...

werds mal probieren...

//EDIT: Also bei mir funzt zwar nich alles was man in die input reinschreibt, aber es funzt erschtmal^^

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
pfeiffe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 35



BeitragVerfasst: Di 10.02.04 10:33 
Was hast du denn getestet? Bei mir geht garkein Parameter in dieser Input-File.
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Di 10.02.04 11:03 
ich hab als application die cmd.exe genommen und dann in die inputfile folgendes geschrieben:

ausblenden Quelltext
1:
2:
3:
c:
d:
c:

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
Chris1308
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220

Win XP Prof.
D2005 Prof, D7 Prof, D7 Pers
BeitragVerfasst: Mi 11.02.04 21:07