ErrorLog Event Tutorial

No replies
magius96's picture
Offline
Last seen: 14 weeks 1 day ago
Joined: 04/13/2009
Posts:

I've written a very helpfull ErrorLog Event class. When used correctly, it raises an event that you can use to process errors however you please.

The main benefit to using this class is if you include it in a Code Library project, it provides a means of returning error messages to the application so the application can handle it.

It does not however return the Exception itself, but you can modify it easily to do that if you need to. What it does return is a string containing all error messages and stacktrace's for the error, including any and all inner exceptions.

This tutorial is also a very good, and basic example of using Delegates to setup event handling between a DLL and an application. (Remember, DLLs normally only communicate with applications via return values from functions. This allows extra communications outside of return values.)

You can view the Tutorial project at http://www.compilr.com/IDE/15486

----------------------------------------------------------------------------------------------------
"Coding your life, Compiling your dreams, and crashing your future."
Compilr - C# and VB.NET Advisor