谢欣伦 - 化繁为简系列原创教程 - 通信专题 - 蓝牙设备查找类CxBthRemoteDeviceFind

  这是一个精练的蓝牙设备查找类,类名、函数名和变量名均采用匈牙利命名法。小写的x代表我的姓氏首字母(谢欣伦),个人习惯而已,如有雷同,纯属巧合。

CxBthRemoteDeviceFind的使用如下:

void CUsbScannerDlg::OnBtnRemoteBth() 

{

    // TODO: Add your control notification handler code here

    m_list1.ResetContent();



    BTH_DEV_INFO bdi = {0};

    CString str;

    CxBthRemoteDeviceFind finder; BOOL bRet = finder.FindDevice(); while (bRet)

    {

        finder.GetDeviceInfo(&bdi);

        m_list1.AddString(bdi.szName);

        m_list1.AddString(bdi.szMacAddr);



        str.Format(_T("Class of Device : 0x%08x"), bdi.ulClassofDevice);

        m_list1.AddString(str);

        

        m_list1.AddString("");

        m_list1.AddString("-->Next<--");

        bRet = finder.FindNextDevice();

        

    }        

    finder.Close();

}

  精练的代码不需要过多解释,你们懂的。To be continued...

下载

libComm - v1.2 For WinXP/Win7

你可能感兴趣的:(remote)