Re: How to control the exception handling of a child process?
- From: "Gary Chanson" <gchanson@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Apr 2005 05:19:57 -0400
"Alex Hong" <hctiaa@xxxxxxxx> wrote in message
news:%23doQWZjSFHA.3176@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
> I am building an MFC program that runs other programs by creating a child
> process. And I want to control the exception handling of the child process
> so that when it runs into a NullPointer or DividedByZero exception, the
> program can be aware of it, and I don't want the "Error" dialog to show up.
> Is there a way to do so. If there is, how?
> By the way, I am using Visual C++ .NET 2003 and every time I try to create
> a process using CreateProcessWithLogonW or CreateProcessWithTokenW, the
> compiler says it can not find the identifier. But I have included the header
> file windows.h according to the MSDN Library. Could someone tell me why? I
> have posted the problem in the VSNET group, but it seems no one in the group
> knows the answer.
Jochen's suggestion of using the debugging interface is probably the best
approach, but another would be to inject code into the target processes which
executes SetUnhandledExceptionFilter to install your own exception handler.
It won't be trivial to do this without interfering with exception handling
within the program but it won't be trivial to implement your own debugger
either.
--
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
-gchanson@xxxxxxxx
.
- References:
- How to control the exception handling of a child process?
- From: Alex Hong
- How to control the exception handling of a child process?
- Prev by Date: Re: Enable or disable devices
- Next by Date: Re: Setting system startup time?
- Previous by thread: Re: How to control the exception handling of a child process?
- Next by thread: POSAO
- Index(es):
Relevant Pages
|