Reputation: 311
Using VS2022 17.11 C++ with the OpenXR Microsoft samples. I have my dev environment setup and working with the "out of the box" OpenXR samples and they deploy to HoloLens2, no issues - runs great. The WebView2 (wv2) has been integrated in Unity as a plugin working in HoloLens 2 using the OpenXR tooling. So, from this we know that it can be done.
In my app using the OpenXR sample, I've duplicated the XrSceneLib_UWP into a new module with new name. I deleted all the source and .h files after duplicating and adding the code below. My first goal was simply to get wv2 to configure and navigate. Then I will start looking at making it actually work.
I modified the SampleScene_UWP by adding in the references to my new lib. I searched the sample XRutiliy and found a value that I could check in the app's main.cpp to ensure that the OpenXR and the scene loaded. With it I could reasonably sure that the CoreWindow was created and active. I added a bit of code to extract the HWND which is required by the wv2 to create the controller. After this I made a call to my constructor passing in the HWND and some other parameters.
A few other details: I am using vcpkg to supply the WebView2 (not nuget). I double/triple checked that HoloLens2 has the required Windows 11 version and that WebView2 is installed. To get the solution to build I had to include two DLL files from the vcpkg: Microsoft.Web.WebView2.Core.dll and WebView2Loader.dll ensuring they were in the UWP package.
Current results: Builds, deploys to HoloLens2. If I do not call the wv2 constructor, app runs as expected. If I do attempt to call the wv2 to create the instance the app fails after the call to create the controller. Note the call to create completes successfully but it crashes before it calls its callback function. The error is Procedure is not found.
Apparently, my code section is too big to post. 34167 characters
I have exhausted CoPilot ideas, read the docs multiple times, and devised all kinds of tracing trying to get to the cause. There are multiple missing symbols files and source files that VS cannot find even using the additional option in VS. CoPilot suggestions include, could be a defective configuration, missing file, or countless reasons. I am at a loss after a week of work.
Upvotes: 0
Views: 58