microsoft / Windows.UI.Composition-Win32-Samples

Windows.UI.Composition Win32 Samples
MIT License
459 stars 186 forks source link

WinRT stopped working on Surface Pro due to missing dependencies #95

Closed MartinClementson closed 2 years ago

MartinClementson commented 2 years ago

Hello. My application is using WinRT to capture the desktop with Windows graphics capture. The WinRT part is compiled to a DLL that is loaded during runtime. The application runs on a Surface Pro 7.

The other week I opened up the DLL project to fix a minor bug. Without adding anything new I compiled the DLL for the first time since April 2021. I sent the new DLL to the Surface Pro.

Now the DLL cannot be loaded into my application anymore on the tablet. Using "LoadLibraryA", the error message comes back as "The specified module could not be found". The DLL is there and it's loading from the correct path, some searching on the web has led me to believe that the WinRT DLL has dependencies that it can't find.

Since this happened without me adding anything new to the DLL I suspect that WinRT has been updated since April to include additional dependencies.

I've tried:

The DLL loads fine on my dev machine and other machines which have visual studio installed.

The OS specifications of the tablet are: Edition: Windows 10 Business Version: 21H2 OS Build: 19044.1348 Experience: Windows Feature Experience Pack 120.2212.3920.0

Do you know how I can figure out what dependency I need? I would need to include it in my installer moving forward.

Many thanks for your help. Martin

robmikh commented 2 years ago

Hi Martin,

This is unlikely to be related to WinRT itself, especially if older versions of your dll work on the same system.

I would use dumpbin to view the exports of your two dlls and see if you can spot any new imports that weren't there before. You can access the dumpbin tool by using the "Tools Command Prompt for VS" environment.

I'm going to close this issue but feel free to comment here if you still need help finding the culprit.

MartinClementson commented 2 years ago

Thank you. I apologize for taking up your time with something unrelated. I was sure something had been added to WinRT in an update, but in reality, the build parameters had been wrong. I figured it out thanks to your advice. Much appreciated.