2009-11-18 58 views
0

我有一個在VS.NET 2003中開發的Windows應用程序。 有時我從CallWindowProc()獲取System.NullReferenceException異常。System.NullReferenceException

這裏是例外的堆棧跟蹤

ERROR_STACK_TRACE:在System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr的WNDPROC,IntPtr的的hWnd,MSG的Int32,IntPtr的wParam中,IntPtr的LPARAM) 在System.Windows。 Forms.NativeWindow.DefWndProc(消息&米) 在System.Windows.Forms.Control.DefWndProc(消息&米) 在System.Windows.Forms.Control.WmUpdateUIState(消息&米) 在System.Windows.Forms的。 Control.WndProc(Message & m) at System.Windows.Forms.ScrollableControl.WndProc (消息&米) 在System.Windows.Forms.ContainerControl.WndProc(消息&米) 在System.Windows.Forms.ParkingWindow.WndProc(消息&米) 在System.Windows.Forms.ControlNativeWindow.OnMessage(消息&米) 在System.Windows.Forms.ControlNativeWindow.WndProc(消息&米) 在System.Windows.Forms.NativeWindow.Callback(IntPtr的的HWND,MSG的Int32,IntPtr的WPARAM,IntPtr的LPARAM)

敬請幫助我解決這個錯誤。

感謝和問候, Jagadees。

回答

2

當空對象引用被解除引用時拋出System.NullReferenceException異常。

在你的應用程序中,你應該確保你沒有傳遞應該被設置爲有效數據的Null值。您提供的堆棧跟蹤不足以跟蹤發生錯誤的位置。

相關問題