Click here to Skip to main content
15,889,877 members
Home / Discussions / C#
   

C#

 
AnswerRe: Getting an Exception : (HRESULT: 0x800A140C ) while trying to close Word 2k10 Document Pin
Manfred Rudolf Bihy19-Nov-10 3:42
professionalManfred Rudolf Bihy19-Nov-10 3:42 
GeneralRe: Getting an Exception : (HRESULT: 0x800A140C ) while trying to close Word 2k10 Document Pin
Kushagra Tiwari19-Nov-10 9:47
Kushagra Tiwari19-Nov-10 9:47 
AnswerRe: Getting an Exception : (HRESULT: 0x800A140C ) while trying to close Word 2k10 Document Pin
Ian Shlasko19-Nov-10 10:03
Ian Shlasko19-Nov-10 10:03 
AnswerRe: Getting an Exception : (HRESULT: 0x800A140C ) while trying to close Word 2k10 Document Pin
Kushagra Tiwari22-Nov-10 0:17
Kushagra Tiwari22-Nov-10 0:17 
GeneralRe: Getting an Exception : (HRESULT: 0x800A140C ) while trying to close Word 2k10 Document Pin
GuzmanJ2-Mar-11 10:37
GuzmanJ2-Mar-11 10:37 
AnswerRe: Getting an Exception : (HRESULT: 0x800A140C ) while trying to close Word 2k10 Document Pin
gmr_evgen15-Aug-11 14:08
gmr_evgen15-Aug-11 14:08 
QuestionMoved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
#realJSOP19-Nov-10 1:40
mve#realJSOP19-Nov-10 1:40 
AnswerRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
Luc Pattyn19-Nov-10 1:50
sitebuilderLuc Pattyn19-Nov-10 1:50 
If all the OP wants is to get the app restarted again, then this should suffice:

static class Program {
    [STAThread]        
    static void Main() {
        try {
            Application.EnableVisualStyles();            
            Application.SetCompatibleTextRenderingDefault(false);            
            Application.Run(new Form1());         
        } catch(Exception exc) {
            somehowLogException(exc);
            Application.Restart();
        }     
    }
}


Application.Restart() starts the same app over again, in a new process. The drawbacks should be obvious: the current status will be lost, anything the user has entered/done and wasn't persisted somehow is gone, and some categories of problems will just occur over and over, e.g. a FileNotFound situation typically does not get solved by trying again.

IMO the question doesn't make much sense, there is no general solution to run-time problems, a problem should be handled locally if it can be solved at that level, or propagated up the calling chain.

BTW: very good of you to promote the question from Q&A to a programming forum!

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
dpminusa20-Nov-10 13:51
dpminusa20-Nov-10 13:51 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
dpminusa20-Nov-10 14:54
dpminusa20-Nov-10 14:54 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
Luc Pattyn20-Nov-10 16:02
sitebuilderLuc Pattyn20-Nov-10 16:02 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
dpminusa20-Nov-10 20:06
dpminusa20-Nov-10 20:06 
AnswerRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
Pete O'Hanlon19-Nov-10 2:34
mvePete O'Hanlon19-Nov-10 2:34 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
dpminusa20-Nov-10 14:14
dpminusa20-Nov-10 14:14 
AnswerRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
_Erik_19-Nov-10 3:46
_Erik_19-Nov-10 3:46 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
dpminusa20-Nov-10 14:18
dpminusa20-Nov-10 14:18 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
_Erik_20-Nov-10 16:01
_Erik_20-Nov-10 16:01 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
dpminusa20-Nov-10 20:01
dpminusa20-Nov-10 20:01 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
_Erik_20-Nov-10 23:21
_Erik_20-Nov-10 23:21 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
dpminusa21-Nov-10 4:46
dpminusa21-Nov-10 4:46 
AnswerRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
Rhys Gravell21-Nov-10 23:57
professionalRhys Gravell21-Nov-10 23:57 
Questiondatetimepicker with multiple selected dates Pin
ajithnamboodiri18-Nov-10 19:58
ajithnamboodiri18-Nov-10 19:58 
AnswerRe: datetimepicker with multiple selected dates Pin
Mycroft Holmes18-Nov-10 20:46
professionalMycroft Holmes18-Nov-10 20:46 
AnswerRe: datetimepicker with multiple selected dates Pin
RobCroll19-Nov-10 0:55
RobCroll19-Nov-10 0:55 
AnswerRe: datetimepicker with multiple selected dates Pin
Gregory Gadow19-Nov-10 9:40
Gregory Gadow19-Nov-10 9:40 

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.