5

I have an application which is exclusively operated with touchscreen events. In some cases the application does not respond to touchscreen events anymore. Every tap on the screen causes the following exception:

System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Input.StylusDevice.GetTabletToElementTransform(IInputElement relativeTo)
at System.Windows.Input.StylusDevice.UpdateState(RawStylusInputReport report)
at System.Windows.Input.StylusLogic.PreNotifyInput(Object sender, NotifyInputEventArgs e)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.StylusLogic.InputManagerProcessInput(Object oInput)
at System.Windows.Input.StylusLogic.PreProcessInput(Object sender, PreProcessInputEventArgs e)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

We have also added some logging to check if the device is present (WMI PNPdevice events). The log shows us that the device seems to be unplugged and plugged before that happens. Its a bit strange because the user did not unplug the device. There is an "Device Removal" event followed by a "Device Arrival" Event about 5 seconds later. All other Windows applications do get events - but our application does not process events.

[UPDATE]

I found out that the user unplugged the device for some seconds because the touchscreen was not responding anymore. He also told us that the content one of our datagrind controls was shaking +/- 5px very fast before that happend. Is also not true that every click was not working, scrolling the datagrid worked fine, some buttons were responsive - others not.

Sumary: - Datagrid content starts shaking/flickering very fast - Touchscreen does not respond anymore - User unplugs the touchscreen device for a short time - I get that exception for almost every click. (some buttons are working, datagrid scrolling is working)

[/UPDATE]

Is it a driver issue? Is it a bug in WPF? Is there anything i could do in my application (except restarting it)?

Platform: .net x32 v4.0.30319, c#

  • [What is a NullReferenceException and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Soner Gönül Jul 24 '14 at 10:00
  • just had the same exception (nullreference at System.Windows.Input.StylusDevice.GetTabletToElementTransform) pop up randomly while using my touch driven wpf application. no way to reproduce. :( – santa Oct 01 '14 at 12:40
  • any news about this exception ? I just got it and there are no a lot about it online. Thanks – Morgane May 12 '16 at 22:10
  • I am also getting a null StylusDevice in my handler. I can recreate it by unplugging the monitor's USB cable then plugging it back in. I need to do this 2 to 20 times before the null occurs, but it does occur... It also looks like a WPF bug to me. – Matt Klein Jun 10 '16 at 18:53
  • I am seeing this as well. I reproduce it in touch mode in Simulator. It is not consistent but if I move the pointer around long enough it will fire at System.Windows.Input.StylusWisp.WispLogic.ProcessInputReport(RawStylusInputReport inputReport) – grinder22 Oct 18 '17 at 20:17

0 Answers0