创建窗口句柄时出错

etherealkite 2008-05-21 10:21:15
System.OutOfMemoryException: 创建窗口句柄时出错。 ---> System.NullReferenceException: 未将对象引用设置到对象的实例。
在 System.Windows.Forms.ToolStripSplitStackLayout.LayoutHorizontal()
在 System.Windows.Forms.UnsafeNativeMethods.DefMDIChildProc(IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
在 System.Windows.Forms.Form.DefWndProc(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.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
在 System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
--- 内部异常堆栈跟踪的结尾 ---
在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
在 System.Windows.Forms.Control.CreateHandle()
在 System.Windows.Forms.Form.CreateHandle()
在 System.Windows.Forms.Control.get_Handle()
在 System.Windows.Forms.Form.SetVisibleCore(Boolean value)
在 System.Windows.Forms.Control.Show()
在执行到f.Show();时报出这个错误,前的面代码已执行过,说明f是一个已经实例化的子窗体,真的很郁闷,很生气,我好像没动代码,今天就出现这种错误,而且是打开第一个子窗体时会出现这个错误,以后再打开子窗体都不会出现,有朋友遇到这种问题吗?帮帮忙!
...全文
305 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
etherealkite 2008-05-22
  • 打赏
  • 举报
回复
结贴散分了!
etherealkite 2008-05-22
  • 打赏
  • 举报
回复
谢谢各位朋友,问题已解决,重启电脑就解决了这个问题,没重启电脑时我重新生成了N次解决方案都无济于事,真搞不懂啊!
changjiangzhibin 2008-05-22
  • 打赏
  • 举报
回复
System.NullReferenceException: 未将对象引用设置到对象的实例。

要贴点代码才看得出来
owennol 2008-05-21
  • 打赏
  • 举报
回复
f.show()之前的代码再贴点。。。

110,566

社区成员

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

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

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