没辙了,winform程序报出Win32Exception 不会处理。

猴头 2013-11-30 10:41:13
消息:
{msg=0xf (WM_PAINT) hwnd=0x30a34 wparam=0x0 lparam=0x0 result=0x0}

是在
protected override void WndProc(ref Message m)
抛出的

“存储空间不足,无法处理此命令。”





能不能帮我 分析下 问题出在哪??

...全文
324 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
Null_Reference 2013-12-02
  • 打赏
  • 举报
回复
磁盘满了,是不是有有写入操作..
feiyun0112 2013-12-02
  • 打赏
  • 举报
回复
是不是你使用了什么非托管资源没释放

*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/
猴头 2013-12-02
  • 打赏
  • 举报
回复
引用 10 楼 dongxinxi 的回复:
一次最多读取10000 * 10000的好像,再大要分块
怎么分块呢???
  • 打赏
  • 举报
回复
一次最多读取10000 * 10000的好像,再大要分块
猴头 2013-12-02
  • 打赏
  • 举报
回复
引用 8 楼 feiyun0112 的回复:
有可能,你改成个固定的试试100*100
改了,尺寸缩小一些之后,不报这个 异常了,不过,尺寸缩小之后,不符合要求了......
feiyun0112 2013-12-02
  • 打赏
  • 举报
回复
有可能,你改成个固定的试试100*100
猴头 2013-12-02
  • 打赏
  • 举报
回复
引用 5 楼 feiyun0112 的回复:
怎么触发的?具体代码?
panel 在第一段代码中尺寸被放大了,我跟代码的时候,发现尺寸 放大到了 20000* 20000的大小,会不会 是因为 太大的原因呢??
猴头 2013-12-02
  • 打赏
  • 举报
回复
引用 5 楼 feiyun0112 的回复:
怎么触发的?具体代码?

            this.goHome();
            this.BackUp();
            BaseElement bElement = this.SelElements[0];
            float bw = bElement.getWidth() + bElement.FPenWidth;
            float bh = bElement.getHeight() + bElement.FPenWidth;
            Size size = this.Parent.ClientSize;
            float tw = size.Width - 25;//(空余出滚动条的所占的空间)
            float th = size.Height - 25;
            float scale = Math.Min(tw / bw, th / bh);
            scale = (float)Math.Round(scale, 2, MidpointRounding.AwayFromZero);

            this.isAutoSize = false;
            this.fScaleX = scale;
            this.fScaleY = scale;
            this.fScaleX = (float)Math.Round(fScaleX, 2, MidpointRounding.AwayFromZero);
            this.fScaleY = (float)Math.Round(fScaleY, 2, MidpointRounding.AwayFromZero);
            this.Scale();

            tw = tw / 2;
            th = th / 2;
            PointF bLocation = new PointF(bElement.location.X, bElement.location.Y);
            float tx = bLocation.X - tw;
            float ty = bLocation.Y - th;
            tx = tx <= 0 ? this.Location.X : tx;
            ty = ty <= 0 ? this.Location.Y : ty;
            tx = (float)Math.Round(tx, 0, MidpointRounding.AwayFromZero);
            ty = (float)Math.Round(ty, 0, MidpointRounding.AwayFromZero);
            //(this.Parent as PanelEx).HorizontalScroll.Value = (int)tx;
            //(this.Parent as PanelEx).VerticalScroll.Value = (int)ty;
            //(this.Parent as PanelEx).AutoScrollOffset = new Point((int)tx, (int)ty);
            (this.Parent as PanelEx).AutoScrollPosition = new Point((int)tx, (int)ty);

            this.postInvalidate(false);



//==============
WndProc中:
            try
            {
                base.WndProc(ref m);
            }
            catch (System.InvalidOperationException ex)
            {
            }
            catch (InsufficientMemoryException ex)
            {
            }
            catch (System.ComponentModel.Win32Exception Win32Ex)
            {
                //int WM_PAINT = 0xf;
                //int WM_NCPAINT = 0x85;
                //if (m.Msg == WM_PAINT)
                //{
                //    m.Msg = WM_NCPAINT;
                //    m.HWnd = new IntPtr(0x30bd4);
                //    m.WParam = new IntPtr(0x1);
                //    m.LParam = new IntPtr(0x0);
                //    m.Result = new IntPtr(0x0);
                //}
                base.WndProc(ref m);
            }
feiyun0112 2013-12-02
  • 打赏
  • 举报
回复
怎么触发的?具体代码?
猴头 2013-12-02
  • 打赏
  • 举报
回复
引用 2 楼 ly12530 的回复:
磁盘满了,是不是有有写入操作..
C盘 1空余 30G呢
猴头 2013-12-02
  • 打赏
  • 举报
回复
引用 1 楼 feiyun0112 的回复:
是不是你使用了什么非托管资源没释放 ***************************************************************************** 签名档: http://feiyun0112.cnblogs.com/
在这个过程 没有调用 托管资源啊,就是 触发了 控件的 重绘. 下面是异常信息: 在 System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits) 在 System.Drawing.BufferedGraphicsContext.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height) 在 System.Drawing.BufferedGraphicsContext.AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle) 在 System.Drawing.BufferedGraphicsContext.AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle) 在 System.Drawing.BufferedGraphicsContext.Allocate(IntPtr targetDC, Rectangle targetRectangle) 在 System.Windows.Forms.Control.WmPaint(Message& m) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ScrollableControl.WndProc(Message& m) 在 System.Windows.Forms.ContainerControl.WndProc(Message& m) 在 System.Windows.Forms.UserControl.WndProc(Message& m) 在 WinDraw.DrawView.WndProc(Message& m)

7,765

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧