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.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)