Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash When Oculus Rift S is connected #9706

Open
jacobh12349 opened this issue Sep 4, 2024 · 5 comments
Open

Crash When Oculus Rift S is connected #9706

jacobh12349 opened this issue Sep 4, 2024 · 5 comments
Labels
Investigate Requires further investigation by the WPF team.

Comments

@jacobh12349
Copy link

My wpf app isn't used for vr, but when I open a wpf app while my oculus rift s vr headset is connected to my computer, the wpf app crashes with this exception message, I think the wpf app is thinking the oculus rift controllers are a stylus, and it crashes because of that for some reason.

Exception thrown: 'System.InvalidCastException' in PresentationCore.dll
System.InvalidCastException: Interface not registered

   at MS.Win32.Penimc.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
   at MS.Win32.Penimc.UnsafeNativeMethods.CreatePimcManager()
   at System.Environment.get_StackTrace()
   at MS.Win32.Penimc.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
   at MS.Win32.Penimc.UnsafeNativeMethods.CreatePimcManager()
   at MS.Win32.Penimc.UnsafeNativeMethods.get_PimcManager()
   at System.Windows.Input.PenThreadWorker.WorkerOperationGetTabletsInfo.OnDoWork()
   at System.Windows.Input.PenThreadWorker.WorkerOperation.DoWork()
   at System.Windows.Input.PenThreadWorker.ThreadProc()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
@jacobh12349
Copy link
Author

I'm on the latest version of wpf too

@lindexi
Copy link
Contributor

lindexi commented Sep 5, 2024

@jacobh12349 Could you try enable the WMPOINTER by the code:

        public App()
        {
            AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.EnablePointerSupport", true);
        }

@lindexi
Copy link
Contributor

lindexi commented Sep 5, 2024

From your message at MS.Win32.Penimc.UnsafeNativeMethods.CreatePimcManager(), I can know it can not find the PenImc COM in your drives.

And the PenImc can be bypassed by enable the WMPOINTER message.

@lindexi lindexi added the Investigate Requires further investigation by the WPF team. label Sep 5, 2024
@jacobh12349
Copy link
Author

AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.EnablePointerSupport", true);

I don't want my app to support the rift controllers though, i just have my wpf app running in the background.

@jacobh12349
Copy link
Author

i also dont have any styluses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team.
Projects
None yet
Development

No branches or pull requests

2 participants