Share via


Generate a Dump File from a Handled Exception (Compact 7)

3/12/2014

You can use Windows Embedded Compact Error Reporting to gather information about a particular situation that you want to analyze by creating a handled exception that calls ReportFault to generate a dump file.

The Error Reporting system generates a dump file automatically when a second-chance exception occurs. To generate a dump file when a specific event occurs, insert an exception handler that generates an exception based on criteria that you choose. If a second-chance exception occurs in the inserted handler, the Error Reporting system will generate a dump file.

You can upload the dump file to the Microsoft Watson website or you can save the dump file on the device. For more information, see Upload Dump Files and Save Dump Files on a Device.

To generate a dump file from a handled exception

  1. Include Windows Embedded Compact Error Reporting in your OS design. For more information, see Include Error Reporting in the OS.

  2. Use _try and _except statements to insert an exception handler in your application code that generates an exception. The following example shows how to generate a dump file from a handled exception. For more information about the functions in this example, see ReportFault and GetExceptionInformation. For information about try-except statements, see try-except Statement.

    __try
        {
            FunctionThatGeneratesAnException();
        }
    __except(ReportFault(GetExceptionInformation(),0), EXCEPTION_EXECUTE_HANDLER)
        {
            SomeHandlerFunction();
        }
    

See Also

Tasks

Generate a Dump File Automatically
Generate a Dump File from a Process
Capture a Dump File While Debugging

Concepts

Generate Dump Files