Autor Beitrag
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Fr 20.05.05 12:51 
Hallo!

Wie kann ich eine Exception, die in meiner Anwendung ausgelöst wurde ohne das Application.OnException abfangen?
Ich möchte nämlich, dass eine Klasse die Fehlerbehandlung übernimmt, aber es gelinbgt mir nicht in der Create-Prozedur dieser Klasse die Application.OnException-Prozedur zu übergeben.
Wie könnte man das lösen?

Alstar
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 20.05.05 12:53 
Ähm.. Ich versteh die Frage nicht so ganz. Aber kennst du den try ... except ... finally ... end;-Block? ;)
Alstar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Fr 20.05.05 12:55 
Klar kenn ich den.

Aber kennst du das Application.OnException-Ereignis?
Das fängt alle unbehandelten Exceptions ab. Und genau diese Prozedur will ich in eine Klasse einbauen.
Aber ich weiß nicht, wie ich eine Klasseneingene-Prozedur mit dem Application.OnException verbinden kann.

Alstar
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 20.05.05 12:58 
Wie jetzt? Du möchtest eine Klasse erstellen, wenn Application.OnException ausgelöst wird? Oder willst du in deiner Klassen das OnException-Ereigniss auslösen? :gruebel:
Alstar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Fr 20.05.05 13:02 
Nein :cry:

Ich will ganz einfach, dass in meiner Klasse eine Prozedur gestartet wird, wenn OnException auftritt.
Aber ich möchte das nicht von "außen" zuweisen müssen. Also nicht so:

ausblenden Delphi-Quelltext
1:
Application.OnException := Klasse.Prozedur;					


Sondern ich will entweder das OnException-Event direkt in meiner Klasse abfangen, oder das Event irgendwie in der Create-Prozedur meiner Klasse übergeben.

Alstar
Alstar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Fr 20.05.05 14:21 
So. Habs rausbekommen. Hab aber doch die Application.OnException benutzt (bzw. hab sie benutzen können)

Alstar