Unhandled Exception/Missing Graphics

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
dfw
Newbie
Newbie
Posts: 2
Joined: Sat Sep 06, 2003 4:00 am

Unhandled Exception/Missing Graphics

Post by dfw » Fri Jan 23, 2004 5:31 am

I am experiencing a problem when a DrawLine tool is active and a user has a context menu displayed at the same time as a DrawLineItem is selected. The problem occurs when the user accidentally clicks the left mouse button and moves the mouse slightly while the right mouse button is held down.

The application then generates an unhandled exception (object reference not set to an instance of an object) in DrawLine.DoMouseUp, then exits...

I know they are unusual circumstances, but it is happening repeatedly with a particular user with an unsteady hand. He, unfortunately, is having to restart the application many times per day and getting terribly frustrated.
The only way I have been able to catch the exception is by surrounding Application.Run(...) with a try... catch block. Needless to say, catching the exception at this point is just too late.

I was using the previous version of the TeeChart dll, and did not update out of fear of incompatibility between versions until this problem got out of hand.

Unfortunately, I am 'dead in the water' now because I updated to the most recent version and the Graphics3D.Graphics (System.Drawing.Graphics) property has been removed.

It has been necessary for us to use the Graphics object extensively to achieve our desired aesthetic results and has worked marvelously, until now...

1. Have you, by chance, added any exception handling to the DrawLine.DoMouseUp method?

2. Can you put the Graphics3D.Graphics property back so I can continue to use TeeChart in my app, or suggest another way to access the Graphics object?


Please help!
-Dave

dfw
Newbie
Newbie
Posts: 2
Joined: Sat Sep 06, 2003 4:00 am

Drawing problem OK/ Exception still unhandled...

Post by dfw » Fri Jan 23, 2004 6:18 am

I was able to get hold of the Graphics object by casting the Graphics3D object as Graphics3DGdiPlus and using that class's Graphics property.

Our drawing routines now work great with the most recent version of the dll.

I have been able to duplicate the issue with the unhandled exception in DrawLine.DoMouseUp with the most recent version of the .dll...

Thanks!
--Dave

Here's the stack trace:

Code: Select all

Main: Object reference not set to an instance of an object.

   at Steema.TeeChart.Tools.DrawLine.DoMouseUp(MouseEventArgs e, Cursor& c)
   at Steema.TeeChart.Tools.DrawLine.MouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
   at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
   at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e)
   at Steema.TeeChart.Chart.DoMouseUp(MouseEventArgs e)
   at Steema.TeeChart.TChart.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)

Post Reply