带有蓝牙问题的WSALookupServiceBegin() [英] WSALookupServiceBegin() with bluetooth problem

查看:145
本文介绍了带有蓝牙问题的WSALookupServiceBegin()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi, I work on a multithreading application which use Bluetooth for recieve data from devices. Language is Native C++.
Each device is serviced by its own thread. I use Windows Sockets to interact with BT-devices, so to search BT-devices, I call the. WSALookupServiceBegin() function, then WSALookupServiceNext() and at the end WSALookupServiceEnd(). I have to perform searching procedure not only at the start of the program, but periodically, in order to work with newly paired BT-devices.
When I call the WSALookupServiceBegin() function and don't interact with any BT-device at the same time everything works fine, but when I call the WSALookupServiceBegin() while other thread is interacting with a BT-device, I get an exception: Unhandled exception at 0x000000013FC057B2 in ASUPTerminalBT.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF. This exception throws when program tries to send a data to the BT-device. It seems like WSALookupServiceBegin() does something whith memory allocated for the device address. I'll be very appreciate if you help me to solve this problem.

推荐答案

这篇关于带有蓝牙问题的WSALookupServiceBegin()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆