我有好多带有MSChart控件的UserControl(C# WinForm),打包成DLL后在Delphi中调用,MSChart没任何点击事件处理,在Delphi中调用时,有时点击MSChart图形会报溢出错误(在.net环境下不会报),错误提示如下:See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************
System.ArithmeticException: Overflow or underflow in the arithmetic operation.
at System.Windows.Forms.DataVisualization.Charting.AxisScaleView.get_ViewMaximum()
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetDefaultFromIndexes(Axis axis)
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetDefaultFromIndexesOrData(Axis axis, AxisType axisType)
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetDefaultAxesValues()
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetData(Boolean initializeAxes, Boolean checkIndexedAligned)
at System.Windows.Forms.DataVisualization.Charting.ChartArea.ReCalcInternal()
at System.Windows.Forms.DataVisualization.Charting.ChartPicture.Paint(Graphics graph, Boolean paintTopLevelElementOnly)
at System.Windows.Forms.DataVisualization.Charting.ChartPicture.PaintOffScreen()
at System.Windows.Forms.DataVisualization.Charting.Selection.HitTest(Int32 x, Int32 y, Boolean ignoreTransparent, ChartElementType[] requestedElementTypes)
at System.Windows.Forms.DataVisualization.Charting.Selection.HitTest(Int32 x, Int32 y)
at System.Windows.Forms.DataVisualization.Charting.Chart.HitTest(Int32 x, Int32 y)
at BaseControls.NewChart.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
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)
************** Loaded Assemblies **************不知有没有人遇到过这样的问题?求高人解答
just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************
System.ArithmeticException: Overflow or underflow in the arithmetic operation.
at System.Windows.Forms.DataVisualization.Charting.AxisScaleView.get_ViewMaximum()
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetDefaultFromIndexes(Axis axis)
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetDefaultFromIndexesOrData(Axis axis, AxisType axisType)
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetDefaultAxesValues()
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetData(Boolean initializeAxes, Boolean checkIndexedAligned)
at System.Windows.Forms.DataVisualization.Charting.ChartArea.ReCalcInternal()
at System.Windows.Forms.DataVisualization.Charting.ChartPicture.Paint(Graphics graph, Boolean paintTopLevelElementOnly)
at System.Windows.Forms.DataVisualization.Charting.ChartPicture.PaintOffScreen()
at System.Windows.Forms.DataVisualization.Charting.Selection.HitTest(Int32 x, Int32 y, Boolean ignoreTransparent, ChartElementType[] requestedElementTypes)
at System.Windows.Forms.DataVisualization.Charting.Selection.HitTest(Int32 x, Int32 y)
at System.Windows.Forms.DataVisualization.Charting.Chart.HitTest(Int32 x, Int32 y)
at BaseControls.NewChart.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
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)
************** Loaded Assemblies **************不知有没有人遇到过这样的问题?求高人解答
解决方案 »
- C# BackGroundWorker跨线程
- C# 怎么判断 局域网发来文件的格式和大小
- Image.FromFile 方法怎么给图片加背景颜色
- 怎么知道Clipboard中数据大小?
- 谁会做winform的异步开发吗,我想后台在处理,前台显示进度条。
- 请教关于winform连接数据库语句
- 请问动态添加的Form如何命名?
- 关于VSS的数据库大小压缩问题
- 请高手推荐一本讲解如何使用C#和水晶报表9编写财务报表的书!!
- 我想学一下C#,请同胞们提供一下参考书籍。
- List<String> myList = new List<String>()插入数据库
- 有这样一个动态库函数nt ReadCardNo(char * sCardNo,char * sPsamInfo,int nComPort),如何调用,请大家指点
一般出现溢出错误,是因为DLL需要调用方释放内存, 如释放字符串类型的内存,最后卸载DLL
不知道这些你做没?有些情况下,释放了还出现错误,是因为字符串的大小不符合。
这个问题暂时解决了,没找到问题的根源。我解决的方法是重写了OnMouseDown OnMouseClick OnMouseUp方法,不做任何操作