Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The Good Exception 1

Status
Not open for further replies.

JurkMonkey

Programmer
Nov 23, 2004
1,731
CA
I received this brilliant exception today.

I guess Microsoft gets upset when things happen correctly...

Code:
System.ComponentModel.Win32Exception: The operation completed successfully
   at System.Windows.Forms.DibGraphicsBufferManager.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)
   at System.Windows.Forms.DibGraphicsBufferManager.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)
   at System.Windows.Forms.DibGraphicsBufferManager.AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetBounds)
   at System.Windows.Forms.DibGraphicsBufferManager.AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetBounds)
   at System.Windows.Forms.DibGraphicsBufferManager.AllocBuffer(IntPtr target, Rectangle targetBounds)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
 
Here's a quote from Bob Powell * [MVP] Visual C#, System.Drawing):

I have seen this on several occasions before and it seems to be related to
what I think is a bug in the automatic double buffering system of Windows
Forms. Unfortunately I haven't been able to put my finger on exactly what
the problem is otherwise I would have filed a bug report with MS.

My workaround for this is to use manual double buffering which is described
in Windows Forms Tips and Tricks.

Here's the link:
 
I do not know. I was bored, read your post and dugg a little bit here and there. Should be easy to reproduce in a small WinForms application (on .NET 1.1) which can be imported by VS2005 and run on .NET 2.0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top