Problem occurs when I run it. For a simple test, I paired a bluetooth earphone to my PC and ran the sample code as is. It throws error 10049 at line 381. For some reason the connect() is failing.
Can anyone point out the reason for it? And if there is any solution or some other similar method of connecting to bluetooth devices (I would prefer something simple and low-level method, not .NET managed method), please.
I am using MSVS2022, c++14 standard (c++20 gives compiler error).
@George P, Thanks for the response. The code compiles with c++17. It can find the device and address etc. But when I try to connect to the device, it gives error. I was looking for a way to connect to bluetooth devices without using the managed code examples. The other sample codes I found are all .NET managed codes. Is there any low-level methods like this for windows 10? Or more specifically, a simple method unlike using Windows's Bluetooth and Generic namespaces.