I'm using ultrawintoolbars 5.3 in a project (VS.net C# windows app) on terminal server. Randomly I get the error "the object is currently in use elsewhere." I've searched your forums and found a discussion about this that ended without a stated resolution in the thread. The Infragistics employee that answered was Andrew Smith. He though there was a hotfix for this somewhere. This thread happened Oct 12,2006. Here is the link to the thread:
http://news.archive.infragistics.com/readmessage?id=%3C7e787976$4227cd95$50f3b@news.infragistics.com%3E&group=infragistics.products.netadvantage.windowsforms.wintoolbars
I'm getting the same exact JIT details as in the thread.
Here is the JIT details:
> ************** Exception Text **************> System.InvalidOperationException: The object is currently in use > elsewhere.> at System.Drawing.Image.get_Height()> at System.Drawing.Image.get_Size()> at> Infragistics.Win.UltraWinToolbars.PopupToolBase.CalculateLogicalSizeOfToolInstance()> at Infragistics.Win.UltraWinToolbars.ToolBase.get_WidthResolved()> at > Infragistics.Win.UltraWinToolbars.ToolbarUIElement.PositionChildElements()> at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase> controlElement, Boolean recursive)> at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase> controlElement, Boolean recursive)> at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams&> defaultDrawParams)> at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle> invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, > Boolean> clipText, Boolean forceDrawAsFocused)> at Infragistics.Win.UIElement.Draw(Graphics graphics, Rectangle> invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)> at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, > Rectangle> invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, > Size> elementSize)> at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, > Rectangle> invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)> at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe)> at> Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnPaint(PaintEventArgs > pe)> 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.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)
Phruby, did you try a hotfix, and did it work around the problem? I'm also seeing it in my use of the toolbars. I should add I'm using v 7.3.
Also, to Infragistics support, it doesn't compute that an old hotfix is mentioned here and in the other thread, but we're on 7.3. Have there been no more recent examples of this still occurring? Can you tell me more about how I can work around this in my own code? What I think is happening is that I'm using the same image resource from more than one tool, and some kind of race condition is occuring on accessing the image resource. Can you confirm, or suggest anything else that might be a problem?
tamalerishi,
tamalerishi said:Have there been no more recent examples of this still occurring? Can you tell me more about how I can work around this in my own code?
My best suggestion to get this issue resolved is to get to us a sample we can use to reproduce the behavior. With such a sample that we can run and debug, we can investigate in-depth to determine a cause. This may or may not point out a bug we need to fix in our toolset, or one that we may have already fixed in later hot fixes and/or volume releases. Also, this may or may not provide us with enough information to suggest a workaround.
I never installed a hot fix. I'm only on 5.3 and there isn't a possibility of upgrading without much pain and suffering from our PMO office. So I had to make due. What I observed is that a busy terminal server or citrix has a latency problem with infragistics controls. The Infragistics control will return back that the object is free but the OS doesn't know that yet resulting in that error.
To get around it, I basically added a loop to the try/catch to see if the object is no longer in use. It tries every quarter of a second to see it can get pass the error. After serveral times it can't it gives up and lets the error happen. I've found it will typically clear itself after a cycle or two.
I know. Lame. But when you can't write code to reproduce the error for Infragistics, you do what you can.