Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

strange exception can anyone cast any light on what may be happening

Measurement studio 8.5 and 8.6 with vs 2008

 

I have an application that usually works fine, however with a specific data set I now get the following exceptions, can anyone suggest what may be the cause of this within the NationalInstruments Library ? I can't produce a test app as this is a commercial prduct using various other libraries.

 

Thanks

 

Paul

 

009-04-01 20:18:50,917 [11] ERROR - Object is currently in use elsewhere.
   at System.Drawing.Graphics.Restore(GraphicsState gstate)
   at NationalInstruments.Restricted.GraphicsScope.Dispose(Boolean disposing)
   at NationalInstruments.Restricted.GraphicsScope.Dispose()
   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)


2009-04-01 20:18:59,904 [11] ERROR - Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Drawing.SafeNativeMethods.Gdip.GdipCreateFromHDC(HandleRef hdc, IntPtr& graphics)
   at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)
   at System.Windows.Forms.PaintEventArgs.get_Graphics()
   at System.Windows.Forms.Control.PaintException(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmEraseBkgnd(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.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)
 

0 Kudos
Message 1 of 19
(6,461 Views)

I'm also getting this when loading the same file sometimes which would seem to be related

 

Paul

 

2009-04-01 20:31:34,466 [11] ERROR - Parameter is not valid.
   at System.Drawing.Graphics.Restore(GraphicsState gstate)
   at NationalInstruments.Restricted.GraphicsScope.Dispose(Boolean disposing)
   at NationalInstruments.Restricted.GraphicsScope.Dispose()
   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)

0 Kudos
Message 2 of 19
(6,460 Views)

Hi Paul,

 

I am not entirely sure what might be causing this but I shall have a look into it for you.  I take it this happens every time?  What are you doing with the data?  In particular updating any indicators? They appear to be graphics errors which is why I mention this.  Do you see the same behavoir on different PCs?  Is there anything about this data inparticular that you think could be causing this?  Or is there a particular section of code that appears to be causing this and if so could you send us a snippet?  This should help to narrow down the issue.

 

If you could answer some of these questions and I can look into this a bit more.

 

Regards,

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 3 of 19
(6,443 Views)

 

It's very similar on different machines and I can see nothing particulary strange with the data, but it's only happening with this dataset, others from the same batch seem fine and it's the first time I've seen this occur.I half suspected 8.6 as this is the first release that's been upgraded to that but after uninstalling it and re-installing 8.5I still got the same thing happening.

 

The only thing that may be happening is that a cursor may be changing colour, but I turned all of our timers that do this off and it still happened. 

 

The application is a number of WaveformGraphs with multiple plots on each graph, also cursors and annotations etc. on a graph. 

 

Thanks

 

Paul

 

0 Kudos
Message 4 of 19
(6,439 Views)

Hi Paul,

 

So this dataset is treated the same as all of the others?  Are these graphs a static view or are they strip charts?


Regards,

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 5 of 19
(6,380 Views)

The dataset is treated in exactly the same way as the others, by static I'm assumin you mean that the data is plotted once and not updated ? The data is actually updated just once with a plotxyappend

 

regards

 

 

Paul

0 Kudos
Message 6 of 19
(6,340 Views)

Hi Paul,

 

To narrow down the cause of this problem we need to work out what is unique about this data set in relation to the other data sets.

How are theses data sets been generated?

Are you plotting this specific data set differently than the others (I assume from your previous comments this is not the case).

 

Basically we need to find out the differences between this data set and the others and what differences there are in your application depending on the data set.

 

Thanks for your assistance with this.

 

Best regards,

 

John

 

 

------
John.P | Certified LabVIEW Architect | NI Alliance Member
0 Kudos
Message 7 of 19
(6,301 Views)

I see nothing strange with the data, in fact it actually plots a couple of times but then bombs out when I try to view it again later (there are a number of charts in memory at once but only one on screen at a time)

 

If it helps I could put together a zip file with the application, symbol files and the data files causing the problem together with instructions how to make it crash.

 

 

Paul

0 Kudos
Message 8 of 19
(6,296 Views)

Hi Paul,

That would be great as it would allow us to re-create the issue and therfore make is far easier to resolve.

 

Thanks

 

John

------
John.P | Certified LabVIEW Architect | NI Alliance Member
0 Kudos
Message 9 of 19
(6,294 Views)

could you send me an email of where to send a link for it to ?

0 Kudos
Message 10 of 19
(6,288 Views)