枚举DirectSound设备的问题
我有一个USB FM设备,设备名字"USB Audio Device".在XP和Vista系统中用下面方法都可以枚举到该设备,在Windows7中却枚举不到.请问还有什么方法?
DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK)DSoundEnumCallback, m_combo_device );
INT_PTR CALLBACK DSoundEnumCallback( GUID* pGUID, LPCSTR strDesc, LPCSTR strDrvName,
VOID* pContext )
{
// Set aside static storage space for 20 audio drivers
static GUID AudioDriverGUIDs[20];
static DWORD dwAudioDriverIndex = 0;
GUID* pTemp = NULL;
if( pGUID )
{
if( dwAudioDriverIndex >= 20 )
return TRUE;
pTemp = &AudioDriverGUIDs[dwAudioDriverIndex++];
memcpy( pTemp, pGUID, sizeof(GUID) );
}
HWND hSoundDeviceCombo = (HWND)pContext;
// Add the string to the combo box
SendMessage( hSoundDeviceCombo, CB_ADDSTRING,
0, (LPARAM) (LPCTSTR) strDesc );
// Get the index of the string in the combo box
INT nIndex = (INT)SendMessage( hSoundDeviceCombo, CB_FINDSTRING,
0, (LPARAM) (LPCTSTR) strDesc );
// Set the item data to a pointer to the static guid stored in AudioDriverGUIDs
SendMessage( hSoundDeviceCombo, CB_SETITEMDATA, nIndex, (LPARAM) pTemp );
return TRUE;
}