Re: How to control the exception handling of a child process?

Tech-Archive recommends: Fix windows errors by optimizing your registry




"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

.



Relevant Pages

  • VS2005 Exception Handling
    ... I understand how an exception handling occurs using try/catch when a single ... control and you need to catch a particular condition. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • How to control the exception handling of a child process?
    ... I am building an MFC program that runs other programs by creating a child ... And I want to control the exception handling of the child process ... a process using CreateProcessWithLogonW or CreateProcessWithTokenW, ... have posted the problem in the VSNET group, but it seems no one in the group ...
    (microsoft.public.win32.programmer.kernel)