简体   繁体   English

Windows Server 2008 r2上BluetoothGetRadioInfo的替代方法

[英]Alternative to BluetoothGetRadioInfo on Windows Server 2008 r2

I have a C++ Windows Bluetooth application that is built on a Jenkins CI server running 2008 r2. 我有一个在运行2008 r2的Jenkins CI服务器上构建的C ++ Windows蓝牙应用程序。 The application builds fine and runs on machines that have the Microsoft Bluetooth stack installed. 该应用程序可以很好地运行,并且可以在安装了Microsoft蓝牙堆栈的计算机上运行。 Unfortunately, there is no Bluetooth support on Server 2008 r2, which prevents execution of our gtest unit test projects on the build server. 不幸的是,Server 2008 r2上没有蓝牙支持,这阻止了我们在构建服务器上执行gtest单元测试项目。

The unit tests themselves do not utilize the Bluetooth stack, but because other library code contains calls to BluetoothFindFirstRadio and BluetoothGetRadioInfo, the unit test application will not run at all. 单元测试本身并不利用蓝牙堆栈,但是由于其他库代码包含对BluetoothFindFirstRadio和BluetoothGetRadioInfo的调用,因此单元测试应用程序将根本无法运行。 These calls are implemented in bthprops.cpl, which is not present in Windows Server 2008 r2. 这些调用在bthprops.cpl中实现,而Windows Server 2008 r2中不存在。

So I could solve this in several ways, but unfortunately I can't find the answers to any of these questions: 因此,我可以通过多种方式解决此问题,但不幸的是,我找不到以下任何问题的答案:

1) Is there an alternative method of acquiring the address of a local Bluetooth device other than BluetoothGetRadioInfo? 1)除了BluetoothGetRadioInfo之外,还有其他获取本地蓝牙设备地址的方法吗? This would allow me to break the link dependency on bthprops.cpl. 这将允许我打破对bthprops.cpl的链接依赖性。

2) Is there a way to trick Windows Server 2008 into thinking that the bthprops.cpl library is on the machine? 2)有没有一种方法可以使Windows Server 2008认为bthprops.cpl库位于计算机上? Or even to trick my unit test executable into thinking it's there so that it can execute? 甚至欺骗我的单元测试可执行文件以为它在那里可以执行?

3) Is there a way to recognize at compile time that I'm on Windows Server so I can #ifdef those functions out of my unit test projects? 3)有没有一种方法可以在编译时识别我在Windows Server上,因此可以从单元测试项目中#ifdef这些功能?

Thanks! 谢谢!

I sussgest you using LoadLibrary/FreeLibrary and GetProcAddress to get function pointers of BluetoothFindFirstRadio/BluetoothGetRadioInfo/..., so your application can run normally without system error ("The program can't start because bthprops.cpl is missing from your computer. Try reinstalling the program to fix this problem.") no matter there is bthprops.cpl or not. 我怀疑您使用LoadLibrary / FreeLibrary和GetProcAddress来获取BluetoothFindFirstRadio / BluetoothGetRadioInfo / ...的功能指针,因此您的应用程序可以正常运行而不会出现系统错误(“该程序无法启动,因为您的计算机缺少bthprops.cpl。请尝试。重新安装程序以解决此问题。“)无论是否存在bthprops.cpl。

I hope this is helpful to you! 希望对您有帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Windows Server 2012 R2 上构建的应用程序在 Windows Server 2008 R2 上失败 - Application built on Windows Server 2012 R2 fails on windows server 2008 R2 Windows Server 2008 R2上的常见对话框:GetOpenFileName中崩溃 - Common Dialogs on Windows Server 2008 R2: crash in GetOpenFileName NetUserAdd在工作组Windows Server 2008 R2上运行时失败 - NetUserAdd failing when running on workgroup Windows Server 2008 R2 Windows 2008 R2中缺少多播消息 - Missing multicast messages in Windows 2008 R2 确定谁在Windows 2008 R2服务器/ Windows 7中访问共享文件夹上的文件 - Determining who is accessing a file on a shared folder in Windows 2008 R2 server / Windows 7 服务器2008 R2中的凭据提供程序 - Credential provider in server 2008 R2 CopyFile / CopyFileEx在Windows Server 2008 R2 SP1 x64中不起作用 - CopyFile/CopyFileEx not working in Windows Server 2008 R2 SP1 x64 在 Windows server 2008 r2 中禁用网络适配器的 C++ 示例 - C++ example to disable a network adapter in Windows server 2008 r2 如何使用WMI或其他CMI中的WMI检测安装在Windows 2003服务器和2008 Server 2003服务器R2和2008服务器R2上的防病毒软件 - How to detect antivirus installed on windows 2003 server and 2008 server 2003 server R2and 2008 server R2 using WMI or other then WMI in C++ 如何在Windows 2008 R2中使用CreateVirtualDisk创建差异VHD - How to create a differencing VHD using CreateVirtualDisk in Windows 2008 R2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM