Re: Focus problems on return from dialog ...
From: Dragon Lord (invalid_at_joke.com)
Date: 02/16/04
- Next message: Jay Witting: "Connecting to a Mysql server via Delphi Tcp/ip componets"
- Previous message: Jamie: "Re: TCP Blocking sockets"
- In reply to: pluton: "Re: Focus problems on return from dialog ..."
- Next in thread: pluton: "Re: Focus problems on return from dialog ..."
- Reply: pluton: "Re: Focus problems on return from dialog ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 15 Feb 2004 23:29:23 -0500
You have to tell the DEBUGGER, not the CODE, you are TELLing the code.
The way exceptions work is
Raising an exception causes the exception dispatcher to go through the
following search for an exception handler:
1. The system first attempts to notify the process's debugger, if any.
2. If the process is not being debugged, or if the associated debugger does
not handle the exception, the system attempts to locate a frame-based
exception handler by searching the stack frames of the thread in which the
exception occurred. The system searches the current stack frame first, then
proceeds backward through preceding stack frames.
3. If no frame-based handler can be found, or no frame-based handler handles
the exception, the system makes a second attempt to notify the process's
debugger.
4. If the process is not being debugged, or if the associated debugger does
not handle the exception, the system provides default handling based on the
exception type. For most exceptions, the default action is to call the
ExitProcess function.
YOUR problem, is that it gets to the debugger FIRST, which is how exceptions
work, if you were to continue running the code, it would run fine. Putting
a billion try/excepts in doesn't change the fact that the debugger gets the
exception, before your exception handler gets it. YOU HAVE TO TELL THE
DEBUGGER TO IGNORE THAT EXCEPTION TYPE. Now, delphi organizes exceptions
into 2 areas, Language and OS. You can see this in the Tools->Debugger
Options. If you go into Language Exceptions, and add in EInvalidOperation,
the debugger will now ignore that exception and instead of stopping, it will
allow the program to continue on with its exception handler.
"pluton" <zielonadupa@poczta.onet.pl> wrote in message
news:c0ol20$s6m$1@news.onet.pl...
> > Most try and except blocks don't work when running under the debugger,
> this
> > is how exceptions work. The only thing you can do is tell the debugger
to
> > ignore that exception. Try and Except will work even for OS exceptions,
> > outside of the debugger.
>
> I put at least 715321543 try except blocks in my code.
> No effect.
>
Like I said, the debugger catches Exceptions BEFORE your try/except block
gets it to handle.
> Could you please tell me WHAT exception and WHERE should I intercept ?
> HOW to command application and debugger to ignore this exception innstead
> displaying this nasty message box ?
>
YOU don't intercept anything, the DEBUGGER intercepts Exceptions. Unless
you rewrite the debugger executable code, you don't have control over the
debugger code.
The Exception you need to ignore, is EInvalidOperation, like you specified
in your first message.
> Regards
> pluton
>
>
If you want more information about exceptions, start with "RaiseException"
in the Win32 SDK that comes with Delphi.
C:\Program Files\Common Files\Borland Shared\MSHelp\Win32.HLP
or if you DON'T have D6, its in "Help->Windows SDK" in the IDE.
Jeremy
- Next message: Jay Witting: "Connecting to a Mysql server via Delphi Tcp/ip componets"
- Previous message: Jamie: "Re: TCP Blocking sockets"
- In reply to: pluton: "Re: Focus problems on return from dialog ..."
- Next in thread: pluton: "Re: Focus problems on return from dialog ..."
- Reply: pluton: "Re: Focus problems on return from dialog ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|