How to catch system exception? RRS feed

  • Question

  • Exception like as below:  Windows shows me a dialog
    (a):Asking if to send error report to MS.
    (b):Which says:
                   the program has stopped working
                   windows can check online for a solution to the problem.
                   ->Check online for a solution and close the program.
                   ->Close the program.
    I have tried codes(Using mci to play midi file) as below to catch exception, but failed.
                    MCIERROR dwErr = mciSendCommand(ID, operation, flag, parameter);
             __except ( EXCEPTION_EXECUTE_HANDLER ){
    1: I run program for 12 hours to play one file repeatly , but the program hangs at MCI_CLOSE when passing 10hours. Once it had hanged at MCI_STATUS. I really want to know how the program hangs, especially is hangs almost at the same position.
    2: The program has failed to play the midi file, with error information: "FM synthesizer test error", but only once. Later it always succeed to play. I also don't know why.
    Saturday, March 3, 2007 8:05 AM