我目前正在尝试运行现有的 VB.NET 项目。WndProc 消息中引发了一个空指针异常,但堆栈跟踪并没有真正给我任何信息。我可以在启动表单的设计器代码中放置一个断点,但是当我单步执行它时,会通过 WndProc 函数触发 NULL 指针异常。上面的方法似乎是 Windows 方法。我唯一的线索是 Msg = 24 和 WParam = 1 的 Message 参数。我认为 HWnd = 5178884 没有帮助。
我正在粘贴堆栈跟踪,以防有人有任何想法。 注意:我屏蔽了 MyNamespace 和 MyBaseForm 和 MyFormA 因为源代码是专有的。这在 .NET Framework 3.5 上的 Visual Studio 2008 中运行
MyNamespace.Forms.MyBaseForm.WndProc(Message& m)\r\n
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n
System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n
System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)\r\n
System.Windows.Forms.Control.SetVisibleCore(Boolean value)\r\n
System.Windows.Forms.Form.SetVisibleCore(Boolean value)\r\n
System.Windows.Forms.Control.set_Visible(Boolean value)\r\n
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n
System.Windows.Forms.Application.Run(ApplicationContext context)\r\n
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()\r\n
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()\r\n
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)\r\n
MyFormA.My.MyApplication.Main(String[] Args)
17d14f5c-a337-4978-8281-53493378c1071.vb:Line 81\r\n
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n
System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n
System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n
System.Threading.ThreadHelper.ThreadStart()"