Click here to Skip to main content
15,920,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Too few parameters. Expected error 1 Pin
#realJSOP21-Mar-06 7:18
professional#realJSOP21-Mar-06 7:18 
QuestionDialog box error Pin
RalfPeter20-Mar-06 13:25
RalfPeter20-Mar-06 13:25 
AnswerRe: Dialog box error Pin
Chris Gao20-Mar-06 14:30
Chris Gao20-Mar-06 14:30 
AnswerRe: Dialog box error Pin
Stephen Hewitt20-Mar-06 15:29
Stephen Hewitt20-Mar-06 15:29 
QuestionDo-it-yourself MFC DLL Pin
dahill20-Mar-06 13:16
dahill20-Mar-06 13:16 
AnswerRe: Do-it-yourself MFC DLL Pin
Christian Graus20-Mar-06 18:02
protectorChristian Graus20-Mar-06 18:02 
AnswerRe: Do-it-yourself MFC DLL Pin
#realJSOP21-Mar-06 7:21
professional#realJSOP21-Mar-06 7:21 
QuestionRegards the retrieving registry problem Pin
Ting Li Che20-Mar-06 12:22
Ting Li Che20-Mar-06 12:22 
i wanna get the device information from the registry and take it as parameter to connect to the particular bluetooth device.

I manage to get the service information but not device infomation.

Below is the code:
/////////////////////////////////////////////////////////////////////
typedef struct _BT_DEVICE /* BT Device structure */
{
BD_ADDRESS bdAddress; //Address of the devcie
UINT8 pageScanRepetitionMode; //Page scan repetetion mode
UINT8 pageScanPeriodMode; //Page scan period mode
UINT8 pageScanMode; //Page scan mode
UINT16 serviceClass; //Service class field
UINT8 majorDeviceClass; //Device class(Major) feild
UINT8 minorDeviceClass; //Device class(Minor) feild
UINT8 clockOffset[2]; //Clock offset
}BT_DEVICE, *PBT_DEVICE;

////////////////////////////////////////////////////////////////////

BOOL retResult = FALSE;
BT_DEVICE devices[1] = {0};
UINT8 retCount1 = 0 ;
BT_DEVICE device1 = {0};
HANDLE sdpHandle = NULL;
BT_SERVICE services[1] = {0};
UINT16 numServices1 = 1;
// INT16 testnumServices;
HANDLE sppConnection = NULL;
BT_SERVICE service = {0};
UINT16 frameSize = 1500;
PINT8 portName = (PINT8) SPP_COM_Port;


HKEY hkTimeZones;
int iErr = 1;
bool bShow = false;
INT dwIndexToFind = -1;

if(BT_IsInitialized())
{
if(BT_Open())
{
int count = 0;


if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,REMOTE_BLUETOOTH_DEVICE_SETTING,0, 0,&hkTimeZones) == ERROR_SUCCESS )
{
DWORD dwIndex = 0;
TCHAR tcKeyName[512];
DWORD dwcbName = 512 * sizeof( TCHAR );
FILETIME ftLastWrite;
HKEY hkTimeZone;
HKEY hkTimeZone2;

AfxMessageBox(_T("test here"));


/*while( RegEnumKeyEx(hkTimeZones,dwIndex++,tcKeyName,
&dwcbName,NULL,NULL,NULL,NULL) !=
ERROR_NO_MORE_ITEMS || count <=1)
{
AfxMessageBox(_T("while"));
count++;
HKEY hkTimeZone;
if( RegOpenKeyEx(hkTimeZones,tcKeyName,0,
KEY_READ,&hkTimeZone) == ERROR_SUCCESS )
{
*/

//

DWORD dwDataSize = sizeof( BT_SERVICE );
if(RegQueryValueEx(hkTimeZone,_T("service"),NULL,
NULL,(BYTE*)&service,&dwDataSize)== ERROR_SUCCESS)
AfxMessageBox(_T("Got service"));
else
AfxMessageBox(_T("No service"));




DWORD dwDataSize2 = sizeof(BT_DEVICE);
if(RegQueryValueEx(hkTimeZone2,_T("device"),NULL,
NULL,(BYTE*)&device1,&dwDataSize2)== ERROR_SUCCESS)
AfxMessageBox(_T("Got device"));
else
AfxMessageBox(_T("No device"));



RegCloseKey( hkTimeZone );
RegCloseKey( hkTimeZone2 );





/*
}
else
AfxMessageBox(_T("subkey not open"));
dwcbName = 512 * sizeof( TCHAR );
}
RegCloseKey( hkTimeZones );

*/

}
else
AfxMessageBox(_T("Open Register fail"));

retResult = TRUE;
}
else
AfxMessageBox(_T("BT not yet open!"));

}
else
{
AfxMessageBox(_T("BT not yet initialized!"));
BT_Init();
SPPConnectToSerialPort();
}



sdpHandle = SDAP_GetConnection(&device1);

sppConnection = SPP_Connect(&device1, &service, &frameSize, NULL,portName);


if(sppConnection == NULL)
{
AfxMessageBox(_T("Finally SPP Not connect"));

}
else
{
AfxMessageBox(_T("Finally SPP connect"));
}

I fail to get the device1 info from the method above.

Another question, how could I put the define for the path REMOTE_BLUETOOTH_DEVICE_SETTING which is always vary?

Please give me any comment or suggestion on this.

Thanks
Questionchange prog. Pin
jwacho520-Mar-06 12:12
jwacho520-Mar-06 12:12 
AnswerRe: change prog. Pin
Christian Graus20-Mar-06 12:45
protectorChristian Graus20-Mar-06 12:45 
GeneralRe: change prog. Pin
jwacho520-Mar-06 13:11
jwacho520-Mar-06 13:11 
GeneralRe: change prog. Pin
Christian Graus20-Mar-06 13:16
protectorChristian Graus20-Mar-06 13:16 
QuestionConvert Winhelp App to use HTML help Pin
CTaylor8920-Mar-06 11:48
CTaylor8920-Mar-06 11:48 
Questionuninstalling VC++ express edition 2005 Pin
thierrypp20-Mar-06 11:41
thierrypp20-Mar-06 11:41 
AnswerRe: uninstalling VC++ express edition 2005 Pin
Christian Graus20-Mar-06 12:46
protectorChristian Graus20-Mar-06 12:46 
AnswerRe: uninstalling VC++ express edition 2005 Pin
Ștefan-Mihai MOGA21-Mar-06 0:34
professionalȘtefan-Mihai MOGA21-Mar-06 0:34 
GeneralRe: uninstalling VC++ express edition 2005 Pin
thierrypp21-Mar-06 2:13
thierrypp21-Mar-06 2:13 
Questionnew to dlls! Pin
69 Bay20-Mar-06 11:29
69 Bay20-Mar-06 11:29 
AnswerRe: new to dlls! Pin
Chris Gao20-Mar-06 16:07
Chris Gao20-Mar-06 16:07 
AnswerRe: new to dlls! Pin
Abebe20-Mar-06 20:07
Abebe20-Mar-06 20:07 
AnswerRe: new to dlls! Pin
#realJSOP21-Mar-06 7:26
professional#realJSOP21-Mar-06 7:26 
QuestionAccess Violation !! Pin
sottos20-Mar-06 11:28
sottos20-Mar-06 11:28 
QuestionOutputs in bold form... Pin
yonis 1120-Mar-06 8:36
yonis 1120-Mar-06 8:36 
AnswerRe: Outputs in bold form... Pin
Stephen Hewitt20-Mar-06 11:38
Stephen Hewitt20-Mar-06 11:38 
GeneralRe: Outputs in bold form... Pin
Chris Gao20-Mar-06 16:22
Chris Gao20-Mar-06 16:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.