I am trying to use the Windows API to discover and communicate with Blue
Tooth devices. When I call WSALookupServiceBegin it works ok but
WSALookupServiceNext fails with 10050 Network Failure. Has anyone
successfully used the windows API to control the Blue Tooth on a iPaq? The
code for WSALookupServiceNext is below.
PBYTE pOut = (PBYTE)LocalAlloc (LPTR, MYBUFFSIZE);
if (!pOut) return -1;
WSAQUERYSET *pQueryResult = (WSAQUERYSET *)pOut;
for (i = 0; i < nMax; i++) {
dwLen = MYBUFFSIZE;
dwFlags = LUP_RETURN_NAME | LUP_RETURN_ADDR;
rc = WSALookupServiceNext (hLookup, dwFlags, &dwLen, pQueryResult);
if (rc == SOCKET_ERROR) {
rc = GetLastError();
break;
}