How to use C++/WinRt API like as part of DLL without user interface(UI)
sunil maurya
21
Reputation points
Hi, I am attempting to utilize the C++/WinRT code provided in the sample of LampArray, cppwinrt to create a 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 you please guide me on whether there's a method to directly invoke the API in my code without relying on the UWP UI portion?
Note: I am trying to create a DLL to access the lamp devices attached to system like lights/LEDs, etc.
Regard,
Sunil