3 ms·
When does this actually happen? Oh, for Pete's sake. I'm not learning what I hoped to here, and you've made up your mind.
by Lagged2Death 15y ago
When does this actually happen?
Oh, for Pete's sake. I'm not learning what I hoped to here, and you've made up your mind.
- dpark 15y agoWhat were you hoping to learn? Can you give me a practical situation where an exception is thrown despite there not being an error, aside from the canonical Integer.Parse() example? In my experience, that's not the bulk of any practical program, and it's still exceptional from the point of view of the Parse function. I'd be interested in discussing this, but I'm not really sure what you think would be an improvement. And yes, it's a rather uphill battle if your proposal is to use error codes most of the time. I think that ship already sailed (although there's a strong case for error codes in C++, but that's kind of a special case).
- julianz 15y agoAn example comes to mind, from the very issue I'm working on at the moment: System.ComponentModel.Win32Exception: The operation completed successfully at System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)
- dpark 15y agoThat's really terrible, and I can't defend that. However, in the interest of trying to be helpful, my guess is that you have a bug in your app that plays poorly with a bug in Win32. A quick search for BufferedGraphicsContext.CreateCompatibleDIB yielded this question on SO (link to top answer) which indicates a resource leak may be at fault: http://stackoverflow.com/questions/1209769/system-componentmodel-win32exception-the-operation-completed-successfully/1209804#1209804 http://stackoverflow.com/questions/1209769/system-componentm...