Im develop an application in windows mobile 5.I have take the BT_ADRR via WSALookupServiceNext and i m trying to register a virtual port for this bluetooth device
I have tries all the ports form 1-9 but nothing the RegisterDevire return 0
My code is:
PORTEMUPortParams pp;
memset (&pp, 0, sizeof(pp));
HANDLE bth;
pp.channel = 0; //I don't know if this right
pp.flocal = FALSE;
pp.device = pbta->btAddr; //Bluetooth Address
pp.uuidService = SerialPortServiceClass_UUI
D; //defined in bt_sdp.h
pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_D
CB;
WCHAR sComm[10] = _T("\0");
int i;
for(i = 9; i >= 0; i--){
bth = RegisterDevice(L"COM", i , L"btd.dll", (DWORD)&pp);
if(bth)
break;
}
Only in ports 0 and 1 return success but the CreateFile API retrun INVALID_HANDLE_VALUE
Please help me!!!