D
Don Stewart
I receive the error below at least 10 times a day
from some of the many thousands of customer
machines via an automatic error reporting
module we have.
It does not occur everytime on any particular Form.
But it does happen ocaisonally on nearly every Form
and causes a horrible RED X to be painted in it's place.
You'll notice the stacktrace does NOT
go through any of my code at all.
The OnPaint event is NOT being handled by me.
It is ALL 100% framework code.
/////////////////////////////////////////////////////////////////////////////////////////
///////////// BEGIN ERROR INFORMATION ///////////////////
/////////////////////////////////////////////////////////////////////////////////////////
CLR Version: 1.1.4322.2032
Process Memory: 31469568
Error Message: Invalid parameter used.
Method: IntPtr GetHdc()
STACK TRACE:
at System.Drawing.Graphics.GetHdc()
at System.Windows.Forms.ImageList.GetBitmap(Int32 index)
at System.Windows.Forms.ImageCollection.get_Item(Int32 index)
at System.Windows.Forms.ButtonBase.get_Image()
at System.Windows.Forms.ButtonBase.CommonLayout()
at System.Windows.Forms.ButtonBase.PaintFlatLayout(PaintEventArgs e,
Boolean up, Boolean check)
at System.Windows.Forms.ButtonBase.PaintFlatUp(PaintEventArgs e,
CheckState state)
at System.Windows.Forms.ButtonBase.PaintFlat(PaintEventArgs pevent)
at System.Windows.Forms.ButtonBase.PaintControl(PaintEventArgs pevent)
at System.Windows.Forms.ButtonBase.OnPaint(PaintEventArgs pevent)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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)
/////////////////////////////////////////////////////////////////////////////////////////
/////////////// END ERROR INFORMATION ////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
After looking on the web for similar GDI Errors,
I think that using anything other than a Bitmap
in an imagelist may be the source of some problems.
We do have jpegs and icon files mixed in on some
Imagelists ourselves. - any comments?
Also, there is a huge amount of Physical RAM installed
on these systems. But I do notice that these errors
seem to happen on systems that have been running
our program for many hours. Is there some sort of
internal GDI memory or stacks limits that I could check on?
Does anyone have any suggestion on where
to start looking or troubleshooting?
(e-mail address removed)
Systems Architect
Encite Inc.
from some of the many thousands of customer
machines via an automatic error reporting
module we have.
It does not occur everytime on any particular Form.
But it does happen ocaisonally on nearly every Form
and causes a horrible RED X to be painted in it's place.
You'll notice the stacktrace does NOT
go through any of my code at all.
The OnPaint event is NOT being handled by me.
It is ALL 100% framework code.
/////////////////////////////////////////////////////////////////////////////////////////
///////////// BEGIN ERROR INFORMATION ///////////////////
/////////////////////////////////////////////////////////////////////////////////////////
CLR Version: 1.1.4322.2032
Process Memory: 31469568
Error Message: Invalid parameter used.
Method: IntPtr GetHdc()
STACK TRACE:
at System.Drawing.Graphics.GetHdc()
at System.Windows.Forms.ImageList.GetBitmap(Int32 index)
at System.Windows.Forms.ImageCollection.get_Item(Int32 index)
at System.Windows.Forms.ButtonBase.get_Image()
at System.Windows.Forms.ButtonBase.CommonLayout()
at System.Windows.Forms.ButtonBase.PaintFlatLayout(PaintEventArgs e,
Boolean up, Boolean check)
at System.Windows.Forms.ButtonBase.PaintFlatUp(PaintEventArgs e,
CheckState state)
at System.Windows.Forms.ButtonBase.PaintFlat(PaintEventArgs pevent)
at System.Windows.Forms.ButtonBase.PaintControl(PaintEventArgs pevent)
at System.Windows.Forms.ButtonBase.OnPaint(PaintEventArgs pevent)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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)
/////////////////////////////////////////////////////////////////////////////////////////
/////////////// END ERROR INFORMATION ////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
After looking on the web for similar GDI Errors,
I think that using anything other than a Bitmap
in an imagelist may be the source of some problems.
We do have jpegs and icon files mixed in on some
Imagelists ourselves. - any comments?
Also, there is a huge amount of Physical RAM installed
on these systems. But I do notice that these errors
seem to happen on systems that have been running
our program for many hours. Is there some sort of
internal GDI memory or stacks limits that I could check on?
Does anyone have any suggestion on where
to start looking or troubleshooting?
(e-mail address removed)
Systems Architect
Encite Inc.