Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
Posted
Updated 15-Apr-14 23:45pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900