Click here to Skip to main content
15,505,667 members
Home / Discussions / C#
   

C#

 
AnswerRe: UnhandledException Pin
OriginalGriff14-Oct-12 4:49
mveOriginalGriff14-Oct-12 4:49 
GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 5:14
Hamid_RT14-Oct-12 5:14 
GeneralRe: UnhandledException Pin
OriginalGriff14-Oct-12 5:25
mveOriginalGriff14-Oct-12 5:25 
GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 6:03
Hamid_RT14-Oct-12 6:03 
GeneralRe: UnhandledException Pin
OriginalGriff14-Oct-12 6:12
mveOriginalGriff14-Oct-12 6:12 
GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 6:25
Hamid_RT14-Oct-12 6:25 
GeneralRe: UnhandledException Pin
jschell14-Oct-12 7:59
jschell14-Oct-12 7:59 
AnswerRe: UnhandledException Pin
Eddy Vluggen14-Oct-12 4:50
professionalEddy Vluggen14-Oct-12 4:50 
C#
static void Main(string[] args)
{
    AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyException);

    throw new ArgumentException("for test");
}

static void MyException(object sender, UnhandledExceptionEventArgs e)
{
    Console.WriteLine("CAUGHT: " + e.ExceptionObject.ToString());
}

Works for me; displays the exception with the custom text in the console, and then switches to the debugger. What did you expect it to do, and what behaviour are you observing?
Bastard Programmer from Hell Suspicious | :suss:
if you can't read my code, try converting it here[^]

GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 5:17
Hamid_RT14-Oct-12 5:17 
GeneralRe: UnhandledException Pin
Eddy Vluggen14-Oct-12 5:22
professionalEddy Vluggen14-Oct-12 5:22 
GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 6:08
Hamid_RT14-Oct-12 6:08 
GeneralRe: UnhandledException Pin
Eddy Vluggen14-Oct-12 9:27
professionalEddy Vluggen14-Oct-12 9:27 
QuestionError in Messagebox solution Pin
Saridakis Manolis13-Oct-12 23:56
Saridakis Manolis13-Oct-12 23:56 
AnswerRe: Error in Messagebox solution Pin
Eddy Vluggen14-Oct-12 1:40
professionalEddy Vluggen14-Oct-12 1:40 
AnswerRe: Error in Messagebox solution Pin
Dave Kreskowiak14-Oct-12 4:58
mveDave Kreskowiak14-Oct-12 4:58 
QuestionProblem with OpenCvSharp Pin
Daniel Heinsohn13-Oct-12 12:54
Daniel Heinsohn13-Oct-12 12:54 
AnswerRe: Problem with OpenCvSharp Pin
Eddy Vluggen14-Oct-12 1:40
professionalEddy Vluggen14-Oct-12 1:40 
GeneralRe: Problem with OpenCvSharp Pin
Daniel Heinsohn14-Oct-12 15:01
Daniel Heinsohn14-Oct-12 15:01 
QuestionRe: Problem with OpenCvSharp Pin
Eddy Vluggen15-Oct-12 1:08
professionalEddy Vluggen15-Oct-12 1:08 
Questionwant to see 1page when MDI use. Pin
Subhajit00113-Oct-12 7:15
Subhajit00113-Oct-12 7:15 
AnswerRe: want to see 1page when MDI use. Pin
Dave Kreskowiak13-Oct-12 8:02
mveDave Kreskowiak13-Oct-12 8:02 
QuestionDrawing a 3D polygon from coordinates (KML) Pin
tokano13-Oct-12 6:20
tokano13-Oct-12 6:20 
AnswerRe: Drawing a 3D polygon from coordinates (KML) Pin
Dave Kreskowiak13-Oct-12 8:07
mveDave Kreskowiak13-Oct-12 8:07 
GeneralRe: Drawing a 3D polygon from coordinates (KML) Pin
tokano13-Oct-12 13:10
tokano13-Oct-12 13:10 
GeneralRe: Drawing a 3D polygon from coordinates (KML) Pin
Dave Kreskowiak13-Oct-12 13:39
mveDave Kreskowiak13-Oct-12 13:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.