Autor Beitrag
Frankieboy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65



BeitragVerfasst: Fr 18.04.08 20:01 
Hallo,

hab schon mehrmals geschrieben und noch das gleiche Problem:

Ich habe die visuelle Komponente TDosCommand in meinem Programm (mit deren Hilfe kann man realtiv einfach Befehlszeilenprogramme ausführen und deren Text-Output abfangen).
Doch jedesmal, wenn ich im Programm DosCommand mit der Funktion Execute gestartet habe und das Konsolenprogramm ausgeführt wurde, habe ich zum Teil Probleme mit Dialogen (angezeigt per Funktion MessageDlg) und Formularen: sie werden verstümmelt, bzw. unvollständig dargestellt. Schließt man das Formular, kommt manchmal gar eine Excpetion "ungültiges Fensterhandle".

Ich bin mir jetzt ziemlich sicher, woran das Problem liegt: im SourceCode von TDosCommand.

TDosCommand ist von der Klasse TObject abgeleitet und läuft also mit dem Haupthread der Application.
Allerdings startet TDosCommand einen seperaten Thread (TThread), in dem dann das gewünschte Befehlszeilenprogramm ausgeführt wird. Nach Beendigung des Programms wird der Thread aufgelöst.
TDosCommand enthält zwar eine Variable
ausblenden Delphi-Quelltext
1:
property Sync: TMultiReadExclusiveWriteSynchronizer read FSync;					

allerdings glaube ich, dass die Synchronisation per BeginWrite, EndWrite (bzw. BeginRead, EndRead) zwischen den beiden Threads nicht so ganz klappt und ich deswegen Speicherverletzungen habe...

Leider kenne ich mich mit Multithreading nicht sehr gut aus und die Hilfe ist indem Fall auch nicht gerade eine - Hilfe.
Deswegen meine Bitte: Falls sich jemand mit dem Thema auskennt, könnte er - wäre mir eine Riesenhilfe - den Sourcecode von TDsoCommand mal schnell überfliegen, ob er so stimmt! :o :o


Thanks a lot

Frankie
Einloggen, um Attachments anzusehen!
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Fr 18.04.08 20:43 
Hi,

Wenn es sich dabei um eine Runtime-Library von Borland handelt, würde ich den Download mal schnell entfernen, ich weiß nicht, wie Borland da steht... Den Source dürfte ja auch jeder bei sich haben.

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Frankieboy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65



BeitragVerfasst: Fr 18.04.08 21:25 
Ne, natürlich keine Runtime Libary von Borland!

is ne Komponente, die ich als Source mal von ner Privatseite (irgend ein Programmierer) runtergalden hab.
Ist absolut Freeware, also kein Problem...

Frankie

PS:
Ich hoffe doch, dass bei Runtime Libaries von Borland/Codegear Fehler wie oben nicht passieren :wink:
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 21.04.08 15:28 
Wenn ich das richtig überblickt hab, fehlt an einigen Stellen die Synchronisation beim Hinzufügen neuer Textzeilen in die Ein- und Ausgabe-Puffer.

Auch ist die Komponente an vielen Stellen SEHR unsauber programmiert ... Wozu brauch man bitte ein Ty-Finally, wenn man im Finally-Block eh nix macht??? Und ähnliche Späße ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mo 21.04.08 15:40 
user profile iconBenBE hat folgendes geschrieben:
Auch ist die Komponente an vielen Stellen SEHR unsauber programmiert ... Wozu brauch man bitte ein Ty-Finally, wenn man im Finally-Block eh nix macht??? Und ähnliche Späße ...


Ich rate mal: Wahrscheinlich soll die Exception ignoriert werden(ist beabsichtigt) letztens hat mir noch jemand erzählt das wäre ein Zeichen für das falsche Konzept :roll:

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 22.04.08 08:45 
user profile iconHidden hat folgendes geschrieben:
user profile iconBenBE hat folgendes geschrieben:
Auch ist die Komponente an vielen Stellen SEHR unsauber programmiert ... Wozu brauch man bitte ein Try-Finally, wenn man im Finally-Block eh nix macht??? Und ähnliche Späße ...


Ich rate mal: Wahrscheinlich soll die Exception ignoriert werden(ist beabsichtigt) letztens hat mir noch jemand erzählt das wäre ein Zeichen für das falsche Konzept :roll:

Ja klar, weil man mit Try-Finally Exceptions fängt. Ich glaubst auch fast :twisted:

Bitte erst denken, dann posten!

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.