ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement studio strange exception

I'm just clearing up any outstanding issues we have with out software and one issue that comes up is a strange exception that I'm having trouble reproducing but is occuring often enought to require fixing. We have upgraded to 8.1 (not sure if it happened before) and when first plotting a chart now  the following is sometimes thrown. Does anyone have any ideas of where I should start looking (especially as the stack trace seems to indicate something I have no control over i.e no start point for me to try to find.) It's normally the first time a waveform plot is generated which causes a red x through the plot but then the application continues on fine.

Object is currently in use elsewhere.
   at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
   at System.Drawing.Graphics.DrawLines(Pen pen, PointF[] points)
   at NationalInstruments.UI.Internal.x.a(Graphics A_0, Rectangle A_1, PointFArrayCollection A_2)
   at NationalInstruments.UI.Internal.a9.a(ComponentDrawArgsInternal A_0)
   at NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
   at NationalInstruments.Restricted.ControlElement.DrawChildren(ComponentDrawArgsInternal args, Rectangle clipRectangle)
   at NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
   at NationalInstruments.Restricted.ControlElement.DrawChildren(ComponentDrawArgsInternal args, Rectangle clipRectangle)
   at NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
   at NationalInstruments.Restricted.ControlElement.DrawChildren(ComponentDrawArgsInternal args, Rectangle clipRectangle)
   at NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
   at NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1)
   at NationalInstruments.Restricted.ControlElement.Paint(PaintEventArgs e)
   at NationalInstruments.UI.WindowsForms.ControlBase.OnPaint(PaintEventArgs e)
   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.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)


Thanks

Paul
0 Kudos
Message 1 of 3
(3,589 Views)

Can you attach a sample application that reproduces this problem?

Thanks

Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,571 Views)
I tracked this down to some cross thread issues in our code, a background thread was getting a bitmap image of the chart whilst another was working on it.


0 Kudos
Message 3 of 3
(3,541 Views)