microsoft / DirectX-Graphics-Samples

This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.
MIT License
6.01k stars 2.02k forks source link

Building and Running #587

Closed niko1point0 closed 4 years ago

niko1point0 commented 4 years ago

I would really like to run the UWP apps that I make, by clicking on exe files, rather than installing a msixbundle or appx. I always noticed that UWP projects are building exe files, but I was never able to run my apps by opening the exe files. Is there any way to fix this?

When I click on the exe files, it always says that DLL files are missing like vccorlib140_app.dll, msvcp140_app.dll, and vcruntime140_app.dll. Even after I manually copy these dlls into the same directory as the exe, the exe does not run.

Is there any way to fix this?

walbourn commented 4 years ago

To launch UWPs you need to run them in the correct context. You can use protocol activation to make this easier. See Microsoft Docs.

There are also power-shell cmdlets you can use. Again, see Microsoft Docs

weltkante commented 4 years ago

On a side note, the plan is to move large parts of the UWP UI framework to Desktop with WinUI 3, so in the future the main remaining difference left between UWP and win32 will be the process activation context. If you don't like the UWP activation model you will be able to just create a win32 (desktop) application and still use the UI framework etc.

niko1point0 commented 4 years ago

I actually just figured it out. I replaced dxgifactory->CreateSwapchainForCoreWindow with dxgifactory->CreateSwapchainForHwnd, the change was inside DeviceResources.cpp, and that worked fine