MMDeviceapi
-
Friday, January 27, 2006 3:32 AM
Hi all,
I'm trying to compile some sample codes from the white paper. The sample codes enumerates the audio end points and print out the display name. I've included mmdeviceapi.h and propkey.h but got failures.
The following are the linking errors
error LNK2001: unresolved external symbol _PKEY_DisplayName
error LNK2001: unresolved external symbol _CLSID_MMDeviceEnumerator
error LNK2001: unresolved external symbol _IID_IMMDeviceEnumerator
Can anyone tell me what's wrong with it? Do I need to include more files? Thanks in advance
All Replies
-
Friday, March 31, 2006 9:26 AMI had same problem , but no answer from Microsoft ?
-
Friday, March 31, 2006 5:16 PM
same problem, but easy solution
hResult = CoCreateInstance(
__uuidof(MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER,
__uuidof(IMMDeviceEnumerator),
(void**)&paWasapi->enumerator); -
Friday, March 31, 2006 5:17 PMyou can use:
hResult = spProperties->GetValue(PKEY_Device_FriendlyName, &value);
for the device name, just like in the Mic Array example -
Friday, April 07, 2006 2:59 AM
Dear plgDavid :
thank you for your help , I use __uuidof() is work .
-
Monday, January 29, 2007 10:13 AM
but how to solve these problems
....
Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 2 error C2146: syntax error : missing ';' before identifier 'PKEY_Audio_ChannelCount'
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 4 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 5 error C2146: syntax error : missing ';' before identifier 'PKEY_Audio_Compression'
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
....Error 300 fatal error C1003: error count exceeds 100; stopping compilation
....
if my project is empty and i ONLY included these files
#include <Audioclient.h>
#include <Audiopolicy.h>
#include <propkey.h>
#include <Mmdeviceapi.h>?
I want to have empty mfc dialog project (made by the creator) with these files included ;)


