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

C#

 
Generalcreate a matrix Pin
Sasuko9-Jun-05 14:22
Sasuko9-Jun-05 14:22 
GeneralRe: create a matrix Pin
MoustafaS9-Jun-05 14:25
MoustafaS9-Jun-05 14:25 
GeneralRe: create a matrix Pin
Christian Graus9-Jun-05 14:25
protectorChristian Graus9-Jun-05 14:25 
Questiontry/catch fails ? Pin
Christian Graus9-Jun-05 13:55
protectorChristian Graus9-Jun-05 13:55 
AnswerRe: try/catch fails ? Pin
MoustafaS9-Jun-05 14:12
MoustafaS9-Jun-05 14:12 
GeneralRe: try/catch fails ? Pin
Christian Graus9-Jun-05 14:24
protectorChristian Graus9-Jun-05 14:24 
GeneralRe: try/catch fails ? Pin
MoustafaS9-Jun-05 14:27
MoustafaS9-Jun-05 14:27 
GeneralRe: try/catch fails ? Pin
Christian Graus9-Jun-05 14:31
protectorChristian Graus9-Jun-05 14:31 
I'm not sure what you mean ? There's obviously an underlying bug that I need to fix, or there would be no exception. However, the other issue I'm trying to pursue is why the user doesn't get a polite error message and a log file to help me diagnose the problem, although some clients are providing a stack trace that obviously did not come from my log file and reporting a normal, ugly exception.

I think the issue I just found with the double initialised file object is the cause, although it's got me beat why that is happening.

public static void ForceLog(string Message)
{
if (debugFile == null)
{
debugFile = new StreamWriter(@"c:\RDC Error Log.txt", true, System.Text.Encoding.ASCII);
debugFile.WriteLine("Program started - " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString());
}

debugFile.WriteLine(Message);
debugFile.Flush();
}

This is supposed to initialise the log file on first write, and report that logging has started. Every other time, it should just log another message. Yes, the file gets closed when the program closes.



Christian Graus - Microsoft MVP - C++
GeneralRe: try/catch fails ? Pin
MoustafaS9-Jun-05 14:45
MoustafaS9-Jun-05 14:45 
GeneralRe: try/catch fails ? Pin
Christian Graus9-Jun-05 14:50
protectorChristian Graus9-Jun-05 14:50 
AnswerRe: try/catch fails ? Pin
Luis Alonso Ramos9-Jun-05 15:45
Luis Alonso Ramos9-Jun-05 15:45 
GeneralRe: try/catch fails ? Pin
Christian Graus9-Jun-05 15:47
protectorChristian Graus9-Jun-05 15:47 
GeneralRe: try/catch fails ? Pin
mav.northwind9-Jun-05 20:13
mav.northwind9-Jun-05 20:13 
GeneralRe: try/catch fails ? Pin
Gary Kirkham13-Oct-05 6:54
Gary Kirkham13-Oct-05 6:54 
AnswerRe: try/catch fails ? Pin
Luis Alonso Ramos13-Oct-05 7:10
Luis Alonso Ramos13-Oct-05 7:10 
GeneralRe: try/catch fails ? Pin
Gary Kirkham13-Oct-05 8:07
Gary Kirkham13-Oct-05 8:07 
GeneralRe: try/catch fails ? Pin
Luis Alonso Ramos13-Oct-05 8:13
Luis Alonso Ramos13-Oct-05 8:13 
GeneralRe: try/catch fails ? Pin
Gary Kirkham13-Oct-05 8:17
Gary Kirkham13-Oct-05 8:17 
QuestionHow to gracefully handle program crashing when executed using Process object Pin
xdansmith9-Jun-05 13:36
xdansmith9-Jun-05 13:36 
AnswerRe: How to gracefully handle program crashing when executed using Process object Pin
nemopeti10-Jun-05 2:03
nemopeti10-Jun-05 2:03 
GeneralRe: How to gracefully handle program crashing when executed using Process object Pin
xdansmith10-Jun-05 9:12
xdansmith10-Jun-05 9:12 
GeneralCOM interop question Pin
Christian Graus9-Jun-05 12:49
protectorChristian Graus9-Jun-05 12:49 
GeneralRe: COM interop question Pin
Dave Kreskowiak9-Jun-05 14:52
mveDave Kreskowiak9-Jun-05 14:52 
GeneralRe: COM interop question Pin
Christian Graus9-Jun-05 14:56
protectorChristian Graus9-Jun-05 14:56 
GeneralRe: COM interop question Pin
Dave Kreskowiak9-Jun-05 16:08
mveDave Kreskowiak9-Jun-05 16:08 

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.