Re: Try Finally...
From: L D Blake (not_at_any.adr)
Date: 10/29/04
- Next message: Joe Smith: "Re: Pentium 1.8Ghz / Windows 2000 / Delphi 6 problem"
- Previous message: Supply and Demand: "Re: Rotating JPEG images?"
- In reply to: VBDis: "Re: Try Finally..."
- Next in thread: Rob Kennedy: "Re: Try Finally..."
- Reply:(deleted message) Rob Kennedy: "Re: Try Finally..."
- Reply:(deleted message) VBDis: "Re: Try Finally..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 29 Oct 2004 00:39:57 -0400
On 29 Oct 2004 03:12:32 GMT, vbdis@aol.com (VBDis) wrote:
>Im Artikel <4180d6d8$0$14941$e4fe514c@news.xs4all.nl>, "Maarten Wiltink"
><maarten@kittensandcats.net> schreibt:
>
>>To prevent this misunderstanding, I have been careful to never say
>>"Delphi SEH". But DoDi does, and by it he means _Delphi_ OO exception
>>handling. And he is allowed to; Microsoft do not have a copyright on
>>calling exception handling "structured". To the best of my knowledge,
>>the term is a strictly defined adjective in relation to exception
>>handling, and Delphi's exception handling fulfills that definition.
>
>I still have no formal definition for SEH - is it the Try... syntax, or is it
>more?
The "formal" definition of Structured Exception Handling lies with the
operating system. No matter how the exception comes up, be it from the os
(i/o, memory, div0...) or from an application (range, type, user...) the OS is
what administers SEH. The overall mechanism is cooperative... the language or
application level creates Guard Frames in the application stack that do
nothing until an exception comes up. When it does happen th OS (not the
language) searches the list of Guard Frames and attempts to locate the handler
for that exception... but ultimately true exceptions are handled by Windows.
So your definition is: SEH := 'A Windows resident method of dealing with
unexpected errors.'
>I prefer SEH as a handy TLA <g> instead of only EH, but often I feel a need for
>separating Windows SEH from Delphi SEH.
There actually is no "Delphi SEH", there is a Delphi error handling mechanism
that uses SEH... but it is not, in and of itself, Structured Exception
Handling. That is Windows.
>Some requirements for SEH in Windows applications are dicated by the Windows
>conventions (data structures and their linkage, usage of the FS register...),
>and the Windows way of reporting exceptions raised e.g. in a DLL to the
>application, as well as how exceptions in a Delphi DLL affect an application
>written in another language. Even if Delphi is free to implement it's own way
>of /handling/ exceptions, as long as these are caught inside Delphi code, the
>implementation must be Windows conforming when modules of other languages are
>involved. Playing in a common sandbox requires to respect some rules and, as we
>all know, Windows rulez ;-)
While it's not true in all cases... this is one case where Windows wins.
Delphi's exception objects are dead fish without the underlying Windows
implementation.
Perhaps the biggest misunderstanding in all this is the tendency to conflate
what Delphi does with what Windows does. Delphi can indeed create exception
objects that do not go through windows SEH at all. However these are not true
exceptions, they're merely a means of using exception objects to advantage. A
true exception will always originate inside Windows and it will always be the
result of an operating system error.
Hence my beef with the way this is done. I have no problem with people using
whatever facility the language gives them... but I do believe it is a mistake
to view something as fundamental to the OS as SEH from a top down
perspective... one needs to see it from the OSs perspective to truly
understand it.
-----
Laura
- Next message: Joe Smith: "Re: Pentium 1.8Ghz / Windows 2000 / Delphi 6 problem"
- Previous message: Supply and Demand: "Re: Rotating JPEG images?"
- In reply to: VBDis: "Re: Try Finally..."
- Next in thread: Rob Kennedy: "Re: Try Finally..."
- Reply:(deleted message) Rob Kennedy: "Re: Try Finally..."
- Reply:(deleted message) VBDis: "Re: Try Finally..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|