473,395 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

WinForms exception not including any code of me

Hi,

I've got the following stacktrace, suddenly while my application was
idle and didn't even have the focus:

System.InvalidOperationException: Object is currently in use elsewhere.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
at System.Windows.Forms.ControlPaint.DrawImageDisable d(Graphics graphics, Image image, Rectangle imageBounds, Color background, Boolean unscaledImage)
at System.Windows.Forms.ButtonInternal.ButtonBaseAdap ter.DrawImageCore(Graphics graphics, Image image, Rectangle imageBounds, Point imageStart, LayoutData layout)
at System.Windows.Forms.ButtonInternal.ButtonBaseAdap ter.DrawImage(Graphics graphics, LayoutData layout)
at System.Windows.Forms.ButtonInternal.ButtonFlatAdap ter.PaintUp(PaintEventArgs e, CheckState state)
at System.Windows.Forms.ButtonInternal.ButtonBaseAdap ter.Paint(PaintEventArgs pevent)
at System.Windows.Forms.ButtonBase.OnPaint(PaintEvent Args pevent)
at System.Windows.Forms.Control.PaintWithErrorHandlin g(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.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The problem is, there is not a single line of my own code within, the
error is purely in the Control implementation. I don't necessarily mean
that there is a bug in the code of the framework, but I cannot find out
where the error could be on my part.

Has anyone got any ideas how I could find out, which of my controls
caused the exception and/or how to deal with the situation.

Best regards,
Martin
Nov 1 '06 #1
2 1889
Comment out all the parts that dealing with System.Drawing and see.

chanmm

"Martin Carpella" <ma*************@gmx.netwrote in message
news:87************@msgid.carpella.net...
Hi,

I've got the following stacktrace, suddenly while my application was
idle and didn't even have the focus:

System.InvalidOperationException: Object is currently in use elsewhere.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect,
Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit
srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr
callbackData)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect,
Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit
srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect,
Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit
srcUnit, ImageAttributes imageAttr)
at System.Windows.Forms.ControlPaint.DrawImageDisable d(Graphics
graphics, Image image, Rectangle imageBounds, Color background, Boolean
unscaledImage)
at
System.Windows.Forms.ButtonInternal.ButtonBaseAdap ter.DrawImageCore(Graphics
graphics, Image image, Rectangle imageBounds, Point imageStart, LayoutData
layout)
at
System.Windows.Forms.ButtonInternal.ButtonBaseAdap ter.DrawImage(Graphics
graphics, LayoutData layout)
at
System.Windows.Forms.ButtonInternal.ButtonFlatAdap ter.PaintUp(PaintEventArgs
e, CheckState state)
at
System.Windows.Forms.ButtonInternal.ButtonBaseAdap ter.Paint(PaintEventArgs
pevent)
at System.Windows.Forms.ButtonBase.OnPaint(PaintEvent Args pevent)
at System.Windows.Forms.Control.PaintWithErrorHandlin g(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.Control.ControlNativeWindow.O nMessage(Message&
m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
The problem is, there is not a single line of my own code within, the
error is purely in the Control implementation. I don't necessarily mean
that there is a bug in the code of the framework, but I cannot find out
where the error could be on my part.

Has anyone got any ideas how I could find out, which of my controls
caused the exception and/or how to deal with the situation.

Best regards,
Martin

Nov 2 '06 #2
"chanmm" <ch*****@hotmail.comwrites:
Comment out all the parts that dealing with System.Drawing and see.

chanmm
Hmm, this is going to be a problem, as there are quite some user-drawn
components in this project. Just wanted to know if I could get more out
of the stacktrace than there obviously is, or if I could somehow get the
exception to contain an identifier of any control involved.

The main problem is that I do not find a way to reproduce the exception,
it simply happens sometimes (rather rarely).

Best regards,
Martin
Nov 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ori | last post by:
Hi, I would like to create some mechanism to handle all the exceptions which will happen in my application. I have one form which is the base form while all the other forms inherit from it. ...
0
by: sean | last post by:
From a parent process, I created a custom windows station and desktop. I then CreateProcess using that new station/desktop. There are no problems launching a plain windows app with this...
1
by: Pieter | last post by:
Hi, In my application VB.NET 2005 application I placed a ReportViewer, and link it to a server-report: Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote...
4
by: Shil | last post by:
Hi, In VC++.Net 2005 visual studio, if I create a new winform drag and drop a button, then double click it to write click event code, then it auto generates the template code for the event in...
1
by: Dave A | last post by:
Hi, I am struggling with two way databinding in WinForms and the DataGridView. I am binding to business object classes (rather than datatables). If I have a collection of these business...
5
by: brian.wilson4 | last post by:
Our group is currently comparing winforms vs webforms.....app is Corp LAN based - we have control of desktops.....Below is pros and cons list we have come up with - if anything strikes you as...
2
by: =?Utf-8?B?TWljaGFlbCBXLg==?= | last post by:
Dear ng, i have developed a winforms application with vs2005. An progress from with a animation and a timer is shown while the application is working. The trouble is, that often a...
4
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
Visual Studio 2005, C# WinForms application: Here’s the question: How can I increase the standard 1 MB stack size of the UI thread in a C# WinForms application? Here’s why I ask: I’ve...
0
tlhintoq
by: tlhintoq | last post by:
My project involves reading magstripe cards, capturing an ID number, then spinning off to do some other things including taking a photograph. 99% of this is done and good. All early phases of work...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.