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



BeitragVerfasst: So 01.04.12 14:40 
Hallo,

wie ist es möglich bei einer FireMonkey-App Debug-Ausgaben auf der Konsole zu machen?
Ich habe es mit WriteLn gemacht und da habe ich einen E/A-Fehler erhalten.

Gruß

Sascha
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 01.04.12 20:41 
Frage: welche Konsole?

Wenn du die Debug-Console meinst, sollte OutputDebugString funktionieren.
Wenn du eine eigene brauchst, musst du die per AllocConsole eine erstellen und dann die passenden Handles verdrahten:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  if AllocConsole then begin
    TTextRec(Input).Handle:= GetStdHandle(STD_INPUT_HANDLE);
    TTextRec(Output).Handle:= GetStdHandle(STD_OUTPUT_HANDLE); // der ist für einfaches Writeln wichtig
    TTextRec(ErrOutput).Handle:= GetStdHandle(STD_ERROR_HANDLE);
  end;

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."