Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1425
Understanding the big red cross (X)
posted

Hi all,

I've witnessed this big red cross appearing in place of an UltraGrid when calls wern't marshalled correctly to the main/UI thread when making use of the control.

I have an application that I've ensured only accesses controls from the main/UI thread.

Recently, we've been stress-testing our application and have witnessed this red cross again. This time it appears in place of a ribbon/toolbar control. It's only ever appeared when we're using excessive amounts of memory - causing some components of the application to become sluggish. One example is when the user creates a scatter UltraChart component that has about 40,000 points of data.

So I have a couple of questions concerning this issue:

  1. I've noticed different chart types have different thresholds for the amount of data they can use (understandably) e.g. a pie chart may start to be a bit slugglish when using more than 100 slices, whereas a scatter chart could cope with 1000 points quite comfortably. Is it normal for a scatter UltraChart to fall over with 40,000 points? Are there any general thresholds that have been established (I understand this is specific to ones PC, but if there are some rough numbers, it'd be much appreciated).
  2. When creating this scatted chart with 40,000 points, it becomes very slow - especially when hovering over the chart to display tooltips etc. Could this cause the red cross to appear in the ribbon/toolbar due to lack of memory or CPU to repaint the controls properly? Maybe an OutOfMemoryException is being thrown in the ribbon/toolbar?

I'd appreciate any more information regarding this red cross. From what I've read so far:

  • It "almost always" occurs when a call is made to a control from another thread (not the main/UI thread it was constructed on).
  • It occurs when a control attempts to Paint itself and an exception occurs.

Any information what so ever (even simply to clarify my current understanding is correct) would be greatly appreciated.

Cheers,

Richard

Parents
No Data
Reply
  • 1425
    posted

    Can anyone help with this? I've now noticed it can occur when using a low amount of memory, so that doesn't seem to affect it. The stack trace I'm getting from the unhandled exception is:

    ************** Exception Text **************

    System.ArgumentException: Parameter is not valid.

       at System.Drawing.Graphics.GetHdc()

       at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureTextGDIOrThemed(String text, Font font, TextFormatFlags textFormatFlags)

       at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureCharacterRangesGDI(String text, Font font, TextFormatFlags textFormatFlags, CharacterRange[] ranges)

       at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.ReMeasureParts(String text, Int32[] parts, Single[] widths, Int32 partStartIndex, Int32 partEndIndex, Font font, Single& lineHeight)

       at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureParts(String text, Int32[] parts, Font font, Single& lineHeight)

       at Infragistics.Win.FormattedLinkLabel.NodeText.TextLayoutInfo.Measure(PositionElementsInfo& info)

       at Infragistics.Win.FormattedLinkLabel.NodeText.PositionSelf(PositionElementsInfo& info)

       at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info)

       at Infragistics.Win.FormattedLinkLabel.NodeBase.Position(PositionElementsInfo& info)

       at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionChildNodes(PositionElementsInfo& info)

       at Infragistics.Win.FormattedLinkLabel.NodeBlock.PositionChildNodes(PositionElementsInfo& info)

       at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info)

       at Infragistics.Win.FormattedLinkLabel.NodeBase.Position(PositionElementsInfo& info)

       at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionElements(IFormattedLinkLabelOwner owner, UIElement containerElem, Rectangle containerRect, Boolean calcIdealLayoutSize, Size& layoutSize)

       at Infragistics.Win.FormattedLinkLabel.FormattedTextUIElement.PositionElementsHelper(Rectangle layoutRect, Boolean setElemRectToIdealSize)

       at Infragistics.Win.FormattedLinkLabel.FormattedTextUIElement.PositionChildElements()

       at Infragistics.Win.UltraWinToolbars.RibbonCaptionUIElement.PositionChildElements()

       at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)

       at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)

       at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)

       at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)

       at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics)

       at Infragistics.Win.UIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics)

       at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics)

       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)

       at System.Windows.Forms.Control.WmPaint(Message& m)

       at System.Windows.Forms.Control.WndProc(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Children