469,962 Members | 2,330 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,962 developers. It's quick & easy.

GDI+ Exception

Hello!
We have experienced following exception in our application that runs
over .net v1.0, I had gone through the internet to find an answer about
it but failed to do so. I had found a comment about this exception by
Mr. Bob Powell (MVP).
Now I want to know that if this problem presists in .net framework
v1.1??

---------------
System.InvalidOperationException: The object is currently in use
elsewhere.
at System.Drawing.Graphics.EndContainer(GraphicsConta iner container)
at System.Windows.Forms.DibGraphicsBufferManager.Rele aseBuffer
(GraphicsBuffer buffer)
at System.Windows.Forms.GraphicsBuffer.Dispose()
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Mes sage& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.WndP roc(Message&
msg)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr
wparam, IntPtr lparam)
----------------------
Maqsood Ahmed
Kolachi Advanced Technologies

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 1922
Hi, When I made my comments about this exception it was in relation to code
running on version 1.1.

My observation of a similar exception was also made using a very simple
test-case which had only standard Windows Forms controls and no third-party
components. The exception you're seeing here is due to code trying to use a
GDI+ Graphics object in two places at once, possibly due to a threading
issue or some race condition. I have noticed that very occasionally, and
unfortunately it's not repeatable otherwise I would have filed a bug report,
the standard Windows Forms double buffering scheme fails in this manner.
Manual doule buffering seems to prevent this from ever happening.

However, in the case you mention the exception is raised inside one of the
SyncFusion third-party tools and it's obvious that they use built-in double
buffering in their tools. It's unlikely that you can turn this off so you
may be stuck with the problem unless SyncFusion kow of any issues with their
grid product.

I would strongly recommend that you upgrade to .NET 1.1 with the latest
service pack in any case. It's free from Microsoft.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"Maqsood Ahmed" <ma***********@gawab.com> wrote in message
news:ep**************@TK2MSFTNGP14.phx.gbl...
Hello!
We have experienced following exception in our application that runs
over .net v1.0, I had gone through the internet to find an answer about
it but failed to do so. I had found a comment about this exception by
Mr. Bob Powell (MVP).
Now I want to know that if this problem presists in .net framework
v1.1??

---------------
System.InvalidOperationException: The object is currently in use
elsewhere.
at System.Drawing.Graphics.EndContainer(GraphicsConta iner container)
at System.Windows.Forms.DibGraphicsBufferManager.Rele aseBuffer
(GraphicsBuffer buffer)
at System.Windows.Forms.GraphicsBuffer.Dispose()
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Mes sage& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.WndP roc(Message&
msg)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr
wparam, IntPtr lparam)
----------------------
Maqsood Ahmed
Kolachi Advanced Technologies

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2
Thanx for such quick and prompt answer. I have posted this issue to
SyncFusion support forum. I hope they'll look into it ASAP.

Maqsood Ahmed
Kolachi Advanced Technologies

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by anonymous | last post: by
5 posts views Thread by Pohihihi | last post: by
6 posts views Thread by Phillip N Rounds | last post: by
2 posts views Thread by Alphonse Giambrone | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.