Click here to Skip to main content
15,888,286 members
Home / Discussions / C#
   

C#

 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 5:49
AseelHadlaq16-Oct-12 5:49 
GeneralRe: Converting from C to C# Pin
Pete O'Hanlon16-Oct-12 6:21
mvePete O'Hanlon16-Oct-12 6:21 
QuestionDirectoryEntry Questions Pin
Erick Kinnee15-Oct-12 4:37
Erick Kinnee15-Oct-12 4:37 
QuestionRe: DirectoryEntry Questions Pin
Richard MacCutchan15-Oct-12 4:45
mveRichard MacCutchan15-Oct-12 4:45 
AnswerRe: DirectoryEntry Questions Pin
Erick Kinnee15-Oct-12 4:49
Erick Kinnee15-Oct-12 4:49 
GeneralRe: DirectoryEntry Questions Pin
Richard MacCutchan15-Oct-12 5:04
mveRichard MacCutchan15-Oct-12 5:04 
AnswerRe: DirectoryEntry Questions Pin
Eddy Vluggen15-Oct-12 5:04
professionalEddy Vluggen15-Oct-12 5:04 
QuestionMessageBox error Pin
Saridakis Manolis14-Oct-12 23:36
Saridakis Manolis14-Oct-12 23:36 
AnswerRe: MessageBox error Pin
Sivaraman Dhamodharan14-Oct-12 23:39
Sivaraman Dhamodharan14-Oct-12 23:39 
AnswerRe: MessageBox error Pin
Pete O'Hanlon15-Oct-12 0:21
mvePete O'Hanlon15-Oct-12 0:21 
AnswerRe: MessageBox error Pin
Eddy Vluggen15-Oct-12 0:43
professionalEddy Vluggen15-Oct-12 0:43 
QuestionUnhandledException Pin
Hamid_RT14-Oct-12 3:38
Hamid_RT14-Oct-12 3:38 
AnswerRe: UnhandledException Pin
OriginalGriff14-Oct-12 3:49
mveOriginalGriff14-Oct-12 3:49 
GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 4:14
Hamid_RT14-Oct-12 4:14 
GeneralRe: UnhandledException Pin
OriginalGriff14-Oct-12 4:25
mveOriginalGriff14-Oct-12 4:25 
GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 5:03
Hamid_RT14-Oct-12 5:03 
GeneralRe: UnhandledException Pin
OriginalGriff14-Oct-12 5:12
mveOriginalGriff14-Oct-12 5:12 
GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 5:25
Hamid_RT14-Oct-12 5:25 
GeneralRe: UnhandledException Pin
jschell14-Oct-12 6:59
jschell14-Oct-12 6:59 
AnswerRe: UnhandledException Pin
Eddy Vluggen14-Oct-12 3:50
professionalEddy Vluggen14-Oct-12 3: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 4:17
Hamid_RT14-Oct-12 4:17 
GeneralRe: UnhandledException Pin
Eddy Vluggen14-Oct-12 4:22
professionalEddy Vluggen14-Oct-12 4:22 
GeneralRe: UnhandledException Pin
Hamid_RT14-Oct-12 5:08
Hamid_RT14-Oct-12 5:08 
GeneralRe: UnhandledException Pin
Eddy Vluggen14-Oct-12 8:27
professionalEddy Vluggen14-Oct-12 8:27 
QuestionError in Messagebox solution Pin
Saridakis Manolis13-Oct-12 22:56
Saridakis Manolis13-Oct-12 22:56 

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.