void MainDialog::FillCategoryList()
{
    // Clear listboxes
    ClearDeviceList();
    ClearFilterList();

    if (m_bShowAllCategories)
    {
        // Emulate the behavior of GraphEdit by enumerating all 
        // categories in the system
        DisplayFullCategorySet();
    }
    else
    {
        // Fill the category list box with the categories to display,
        // using the names stored in the CATEGORY_INFO array.
        // See SysEnumDlg.H for a category description.
        for (int i=0; i < NUM_CATEGORIES; i++)
        {
            m_DeviceList.AddString(categories[i].szName);
        }

        // Update listbox title with number of classes
        SetNumClasses(NUM_CATEGORIES);
    }
}
Exemplo n.º 2
0
size_t CObexPush::LookupDevice() {
    ClearDeviceList();

    IDeviceEnum *pDeviceEnum = NULL;
    HRESULT hRes = _pObex->StartDeviceEnum();
    if (FAILED(hRes)) {
        StartupStore(_T("Obex failed to Start Device Enum %s"), NEWLINE);
        return 0U;
    }
    Sleep(15000);
    //enumerate through the devices
    hRes = _pObex->StopDeviceEnum();
    if (FAILED(hRes)) {
        StartupStore(_T("Obex failed to Stop Device Enum %s"), NEWLINE);
        return 0U;
    }

    hRes = _pObex->EnumDevices(&pDeviceEnum, GUID_NULL);
    if (FAILED(hRes) || (pDeviceEnum == NULL)) {
        StartupStore(_T("Obex failed to Enum Device %s"), NEWLINE);
        return 0U;
    }

    DWORD num = 0;
    IObexDevice *pDevice = NULL;
    while (pDeviceEnum->Next(1, &pDevice, &num) == S_OK) {
        _LstDevice.push_back(pDevice);
    }
    pDeviceEnum->Release();

    return _LstDevice.size();
}
Exemplo n.º 3
0
void CObexPush::Shutdown() {
    ClearDeviceList();
    if (_pObex) {
#if TESTBENCH             
        StartupStore(_T("Obex : Shutdown Obex%s"), NEWLINE);
#endif        
        _pObex->Shutdown();
    }
    CoUninitialize();
    
    // restore previous Bt state
    CBtHandler* pBtHandler = CBtHandler::Get();
    if(pBtHandler && HCI_HARDWARE_SHUTDOWN == _SavedBtState) {
        pBtHandler->StopHW();
    }
}
void MainDialog::FillCategoryList()
{
    // Clear listboxes
    ClearDeviceList();
    ClearFilterList();

    // Fill the category list box with the categories to display,
    // using the names stored in the DMO_CATEGORY_INFO array.
    // See DMOEnumDlg.H for a category description.
    for (int i=0; i < NUM_CATEGORIES; i++)
	{
        m_DeviceList.AddString(dmo_categories[i].szName);
	}

    // Update listbox title with number of classes
    SetNumClasses(NUM_CATEGORIES);

    // Select the first category to show useful information
    m_DeviceList.Select(0);
    OnSelchangeListDevices();
}