views:

259

answers:

2

Hello guys! I have a following problem: My ASP.Net application receives a C++ source code of simple console programm, compiles it with cl.exe (command line VC++ compiler) and runs it using System.Diagnostics.Process. ASP.Net application runs on PC, which can be used for other work (it is not a server, just a working machine). I am hide running program window from user (using Process.CreateNoWindow and Process.WindowStyle = ProcessWindowStyle.Hidden properties), but sometimes received source can contain some crashing instruction (like access to invalid memory address or something else) and programm crashed. Windows show Error Report window (if it is Vista - window with message "Windows is checking for a solution to the problem...") in this case, which distracts user and confuse him. Maybe there is some way to prevent showing this messages or close its automaticaly? I have google a lot about WinAPI, but cannot find a solution. If it is impossible for a single process - maybe I can temporary disable this windows on whole system? Thanks and sorry for my bad English =)

+1  A: 

Starting with Windows Vista, you can use the WinAPI function WerAddExcludedApplicationto disable "Windows Error Reporting" for a specific application.

See: http://msdn.microsoft.com/en-us/library/bb513617(VS.85).aspx

In Windows versions before Vista, the function AddERExcludedApplication had to be used.

See: http://msdn.microsoft.com/en-us/library/bb513614(VS.85).aspx

NineBerry