I have subscribed my application to receive unhandled exceptions in a custom Error class as below:
To test I am generating the Exception in the form_load event with:Code:Application.ThreadException += new ThreadExceptionEventHandler(Error.unhandled);
Code:throw new Exception("Unhandled Exception!!");
It works really well, until I place a Windows Media Player object on the form, if I do this the Exception is handled normally and not through my custom class.
If I generate the errors when using a command button then there is no problem, unlike in form_load.
I also have found that if I comment out the following line then the exception is handled as I would like:
note: WMP is the Windows media player object.Code:((System.ComponentModel.ISupportInitialize)(this.WMP)).EndInit();
Any Ideas? Because Im stumped and also rather irritated by this.
Darren.


Reply With Quote