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.
Thank you.
I am using MSVS2022, c++14 standard (c++20 gives compiler error).
C++20 can break code that worked with an earlier standard if there are any comparisons -- <, > or something similar -- being made.
Does setting the standard to C++17 also bomb out?
There are no URL tags here at CPlusPlus, so the forum's URL interpreter borks up the link you posted. Just slap the URL in place on a line by itself or with some whitespace after the URL to work.
@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.