I am attempting to utilize the C++/WinRT code provided in the sample of LampArray, cppwinrt to create a C++ DLL. However due to the tight coupling of this sample with the UI, I am not able to use below API independently within my DLL code, without incorporating UI Code.
m_deviceAddedRevoker = m_deviceWatcher.Added(winrt::auto_revoke, { get_weak(), &Scenario1_Basics::Watcher_Added});
m_deviceRemovedRevoker = m_deviceWatcher.Removed(winrt::auto_revoke, { get_weak(), &Scenario1_Basics::Watcher_Removed });
Could anyone please guide me on whether there’s a method to directly invoke the API in my C++ DLL code without relying on the UWP UI portion? Note: I am trying to create a C++ DLL to access the lamp devices attached to system like lights/LEDs, etc.