[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Exception in DibGraphicsBufferManager.CreateCompatibleDIB

(Max Christian)

11/24/2004 6:07:00 PM


I got an exception in CreateCompatibleDIB in a stable, deployed
application today -- the stack trace is at the bottom of this message.
The thing is, the trace shows that none of my code was running so I'm at
a loss as to what to do about it.

In case it's relevant, I'm overriding a PictureBox and drawing onto its
Image in the OnPaint override. I'm also doing this:

Private Sub PlanControl_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles MyBase.Resize
Image = New Bitmap(CInt(Width), CInt(Height))
MyBase.Invalidate()
End Sub

Here's the exception:

The parameter is incorrect
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)

If anyone can suggest was might be causing this it would be enormously
helpful. (It was probably running on Windows 98, if that makes any
difference.)

Max Christian

1 Answer

(Max Christian)

11/25/2004 11:15:00 AM

0

Max Christian wrote:
> The thing is, the trace shows that none of my code was running so I'm at
> a loss as to what to do about it.

I'm now getting the following exceptions with the same stack trace, all
coming from the same PC:

The operation completed successfully (!)
This function is only valid in Win32 mode

From the latter I assume that the client PC is running Windows 98/ME.
Does the .NET framework not work on 98 after all?

Max Christian