简体   繁体   中英

Calling UWP api from unmanaged DLL

Currently I have a Credential Provider implemented in C++ and I would like to incorporate BLE communication to it. This is provided in Windows 10 by the UWP class Windows.Devices.Bluetooth.GenericAttributeProfile.GattServiceProvider .

I tried to load to make a UWP DLL implementing the function and load it using LoadLibrary but got an ERROR_NOT_APPCONTAINER

Is it possible to use the UWP APIs from some unmanaged C++ code?

You can not load UWP dll inside of desktop application. However it is possible to use many UWP APIs directly as they are essentially COM-based. Typically anything not depending on application context and having public activation factory (constructor) can be used. For example see How to: Activate and Use a Windows Runtime Component Using WRL .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM