C++/WinRT background task (non UWP)
Hi, I'm looking to create a win32 app utilizing WinRT to use UWP Background Task
I tried to find some samples on the internet and I found two main "official" repos
here
https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/BackgroundTask/cpp
I also found this
https://social.msdn.microsoft.com/Forums/en-US/1ecb28ea-c8fa-484c-a400-3f6e689eca6c/uwpcwinrt-background-task-sample?forum=wpdevelop
but in the end this is seems to be a starter point and later the samples were published under this
https://github.com/microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/BackgroundTaskWinMainComSample/CppWinRT
And the formal doc for it is this
https://video2.skills-academy.com/en-us/windows/uwp/launch-resume/create-and-register-a-winmain-background-task
My initial goal was to create a Win32 app that loads a WinRT component / library (load the .winmd file).
This works well and I can use WinRT "space" from win32 and use all the available apis.
Next I wanted to create a background task based on the interface.
Found the samples, they work for UWP but are crashing on me for C++/WinRT and COM samples above.
I've ran them on three different machines, same result. I must be doing something wrong or something is missing.
Next, I've tried to not use COM and try to use the code to run from the C++/WinRT component I have created,
and the same thing happened, it crashes on me.
In this case I know that the manifest manifest file also plays an important role, but I don't know the correct format it has to be in as for other projects the XML starts with "Package" for the win32 migrated project is starts with "assembly"
For example crashes and the xml see the attached pictures.