奇怪的错误,如何解决?

twodays 2004-07-22 11:46:53
我的程序里面,自动从网上挖掘信息,然后保存在一个HashTable里面,同时填充到一个ListView里面
我发现,当数据太多的时候,就会出问题
错误信息如下:
未将对象引用设置到对象的实例。
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ListView.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.PeekMessage(MSG& msg, IntPtr hwnd, Int32 msgMin, Int32 msgMax, Int32 remove)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at twodays.SmartPoper.MainWindow.Main()

那个错误行里面实际上就只有:
Application.Run(new MainWindow());
这是怎么回事儿呢?

...全文
141 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
twodays 2004-07-22
  • 打赏
  • 举报
回复
奇怪。。。。今早插入2000多条数据的时候就老报错
现在这会儿我再跑程序,都快6000了还没有出过错误
zahuifan 2004-07-22
  • 打赏
  • 举报
回复
是不是 ListView 有Bug呢?
试试换一个k
twodays 2004-07-22
  • 打赏
  • 举报
回复
T_T

应该是它这里的问题:
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)

用Google查了下,也有别人也在一些程序中出现了和我这个一样的错误,
但是就是不知道怎么回事儿~~
amami 2004-07-22
  • 打赏
  • 举报
回复
UP!跟踪,彻底!
phoenixsharp 2004-07-22
  • 打赏
  • 举报
回复

有可能你调用的东西不存在或未被赋值..
twodays 2004-07-22
  • 打赏
  • 举报
回复
和Load事件其实并没有什么关系。。。。
并不是在Load的时候出错
而是程序运行一段时间(时间不定)出错
但是报的错误位置在 Application.Run(new MainWindow());
所以这就很奇怪了。。。
brightheroes 2004-07-22
  • 打赏
  • 举报
回复
跟踪一下MainWindow的Load事件

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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