Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 有没有办法使用winapi打开蓝牙?_C++_C_Winapi_Bluetooth - Fatal编程技术网

C++ 有没有办法使用winapi打开蓝牙?

C++ 有没有办法使用winapi打开蓝牙?,c++,c,winapi,bluetooth,C++,C,Winapi,Bluetooth,我正在寻找一种只使用Windows API打开电脑蓝牙的方法。我在BluetoothAPI.h中没有看到任何用于此的函数。如果你知道任何方法(可能使用设备API),我很乐意听到 这是我想使用Windows API打开的设置: 我不知道Win32 API,但可以通过Windows运行时API轻松完成。枚举可以设置为打开、关闭或禁用 下面是一个UWP示例 对于Win32应用程序,仍然可以访问Windows运行时API,例如使用VC++/ZM标志(“使用Windows运行时扩展”)编译并调用Windo

我正在寻找一种只使用Windows API打开电脑蓝牙的方法。我在
BluetoothAPI.h
中没有看到任何用于此的函数。如果你知道任何方法(可能使用设备API),我很乐意听到

这是我想使用Windows API打开的设置:


我不知道Win32 API,但可以通过Windows运行时API轻松完成。枚举可以设置为
打开
关闭
禁用

下面是一个UWP示例


对于Win32应用程序,仍然可以访问Windows运行时API,例如使用VC++
/ZM
标志(“使用Windows运行时扩展”)编译并调用
Windows::Foundation::Initialize()启动时,正如微软博客中所解释的:。

这是你需要的东西吗?这不是“UWP API”。它是“Windows运行时API”。UWP只是Windows运行时API的一个客户端。将API和平台分开是很重要的。否则,你会引起更多的混乱。例如,您不需要任何特定的编译器选项来使用Windows运行时API
/ZM
不是我熟悉的编译器选项,如果您使用的是WRL或C++/WinRT,也不是必需的。@IInspectable ok谢谢。不知道可以在UWP之外使用C++/WinRT。我必须承认,我现在真的跟不上微软。