Mysterious error dialog on exit....
-
I'm getting very often but not always some kind of error dialog when I quit my app in C# that uses some COM objects. Unfortunately I can't tell what it is because when it pops up the application closes in like 10th of a seccond and I can't see what's the dialog about. This is release build. Debug doesn't report anything in debugger on exit ever. I understand it's very vague but I still need help and hope someone here can help me. How to catch the error? Thanks a lot for help in advance!
-
I'm getting very often but not always some kind of error dialog when I quit my app in C# that uses some COM objects. Unfortunately I can't tell what it is because when it pops up the application closes in like 10th of a seccond and I can't see what's the dialog about. This is release build. Debug doesn't report anything in debugger on exit ever. I understand it's very vague but I still need help and hope someone here can help me. How to catch the error? Thanks a lot for help in advance!
Hi! Have you tried catching a ThreadException in your main thread? Could be worth a try... Regards, mav -- Black holes are the places where god divided by 0...
-
I'm getting very often but not always some kind of error dialog when I quit my app in C# that uses some COM objects. Unfortunately I can't tell what it is because when it pops up the application closes in like 10th of a seccond and I can't see what's the dialog about. This is release build. Debug doesn't report anything in debugger on exit ever. I understand it's very vague but I still need help and hope someone here can help me. How to catch the error? Thanks a lot for help in advance!
It is possible to set a break point at the bottom of your main on
Closing
for the main form. Or if worse comes to worse, create a temporary button that behaves like "Quit" with your break point there. -
I'm getting very often but not always some kind of error dialog when I quit my app in C# that uses some COM objects. Unfortunately I can't tell what it is because when it pops up the application closes in like 10th of a seccond and I can't see what's the dialog about. This is release build. Debug doesn't report anything in debugger on exit ever. I understand it's very vague but I still need help and hope someone here can help me. How to catch the error? Thanks a lot for help in advance!
Try catching the exception raised by Application.Run() in a try catch block or handle the Application.ThreadException event. Graham
-
I'm getting very often but not always some kind of error dialog when I quit my app in C# that uses some COM objects. Unfortunately I can't tell what it is because when it pops up the application closes in like 10th of a seccond and I can't see what's the dialog about. This is release build. Debug doesn't report anything in debugger on exit ever. I understand it's very vague but I still need help and hope someone here can help me. How to catch the error? Thanks a lot for help in advance!
I too periodically see an error dialog flash when I quit my application. It seems to have started after I overrode WndProc to perform some custom drawing in a List View control, and doesn't seem to occur with any consistency. My gut says the window handle is being disposed while some of the painting routines are using it, but in all honestly I don't know enough and shouldn't even speculate. If you find a way to "capture" what the error dialog says, let me know. Regards, Chris -- modified at 23:42 Monday 24th April, 2006
-
I too periodically see an error dialog flash when I quit my application. It seems to have started after I overrode WndProc to perform some custom drawing in a List View control, and doesn't seem to occur with any consistency. My gut says the window handle is being disposed while some of the painting routines are using it, but in all honestly I don't know enough and shouldn't even speculate. If you find a way to "capture" what the error dialog says, let me know. Regards, Chris -- modified at 23:42 Monday 24th April, 2006
-
I'm getting very often but not always some kind of error dialog when I quit my app in C# that uses some COM objects. Unfortunately I can't tell what it is because when it pops up the application closes in like 10th of a seccond and I can't see what's the dialog about. This is release build. Debug doesn't report anything in debugger on exit ever. I understand it's very vague but I still need help and hope someone here can help me. How to catch the error? Thanks a lot for help in advance!
-
Hi! Have you tried catching a ThreadException in your main thread? Could be worth a try... Regards, mav -- Black holes are the places where god divided by 0...
Yeah. But exception seems to pop up after main - when GC is collecting - i'm thinking - and there's no way to trap that.
-
It is possible to set a break point at the bottom of your main on
Closing
for the main form. Or if worse comes to worse, create a temporary button that behaves like "Quit" with your break point there.But exception seems to pop up after
main
in - when GC is collecting - i'm thinking - and there's no way to trap that. -
I think, that you've forgot to dispose some COM objects. Try to set them null value. To see this error, try to set Thread.Sleep(time); after Application.Run(...) with time in milliseconds. Best regards, Alexey.
but shouldn't they be disposed when the applciation quits? what is the GC for then? In any case I think I do set them to null and even call ReleaseComObject - no help :((