Vb.net WndProc消息24是什么

Vb.net WndProc消息24是什么,vb.net,nullpointerexception,wndproc,Vb.net,Nullpointerexception,Wndproc,我目前正在尝试运行现有的VB.NET项目。WndProc消息中引发了空指针异常,但堆栈跟踪并没有真正提供任何信息。我可以在启动窗体的设计器代码中放置断点,但当我单步执行时,它会通过WndProc函数触发空指针异常。上面的方法似乎是Windows方法。我得到的唯一线索是消息参数Msg=24和WParam=1。我认为HWnd=5178884没有帮助 我正在粘贴堆栈跟踪,以防有人有任何想法。 注意:我屏蔽了MyNamespace、MyBaseForm和MyFormA,因为源代码是专有的。它在.NETF

我目前正在尝试运行现有的VB.NET项目。WndProc消息中引发了空指针异常,但堆栈跟踪并没有真正提供任何信息。我可以在启动窗体的设计器代码中放置断点,但当我单步执行时,它会通过WndProc函数触发空指针异常。上面的方法似乎是Windows方法。我得到的唯一线索是消息参数Msg=24和WParam=1。我认为HWnd=5178884没有帮助

我正在粘贴堆栈跟踪,以防有人有任何想法。 注意:我屏蔽了MyNamespace、MyBaseForm和MyFormA,因为源代码是专有的。它在.NETFramework 3.5上的VisualStudio2008中运行

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()"

WM_SHOWWINDOW=24

…这并不是真的有帮助。
看起来要执行的代码的最后一位是第81行,我会对此进行研究。

我只想给出另一个答案,说明如何知道错误来自何处,即使堆栈跟踪没有告诉您任何信息(我问WndProc 24是什么的实际问题)。以防其他人也有同样的问题

我通过VisualStudio上的Debug>Exceptions菜单使用了未处理的异常。请参见此了解详细信息


当C.Barlow回答最初的问题时,请将这一点告诉他。

谢谢。我猜第81行调用来自系统api,因为它名为MyFormA.My.MyApplication.Main。可能是VisualStudio的一部分。该名称是一个guid。这可能不是原因。这里添加的是对WM_SHOWWINDOW的引用。