什么是WndProc消息24

时间:2012-02-08 11:14:26

标签: vb.net nullpointerexception wndproc

我目前正在尝试运行现有的VB.NET项目。 WndProc消息中抛出了一个空指针异常,但堆栈跟踪并没有真正给我任何东西。我可以在启动表单的设计器代码中放置一个断点,但是当我单步执行它时,通过WndProc函数触发NULL指针异常。上层方法似乎是Windows方法。我唯一的线索是Message参数,Msg = 24,WParam = 1.我认为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()"

2 个答案:

答案 0 :(得分:2)

WM_SHOWWINDOW = 24

......不是真的有帮助。 看起来要执行的代码的最后一位是第81行,我会研究它。

答案 1 :(得分:0)

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

我通过调试使用了未处理的异常> Visual Studio上的异常菜单。有关详细信息,请参阅此link

在回答最初的问题时,保持对C.Barlow的观点。