hr = CoCreateInstance(
CLSID_MMDeviceEnumerator, NULL,
CLSCTX_ALL, IID_IMMDeviceEnumerator,
(void**)&pEnumerator);
这个地方可能找不到链接库,
error LNK2019: unresolved external symbol _CLSID_MMDeviceEnumerator
error LNK2019: unresolved external symbol _IID_IMMDeviceEnumerator
解决方法
hr = CoCreateInstance(
__uuidof(MMDeviceEnumerator), NULL,
CLSCTX_ALL, __uuidof(IMMDeviceEnumerator),
(void**)&pEnumerator);
缺少 PKEY_Device_FriendlyName
hr = pProps->GetValue(PKEY_Device_FriendlyName, &varName);
解决方法是 #include <functiondiscoverykeys.h> // PKEY_Device_FriendlyName
posted on 2008-08-20 18:10
helor 阅读(1948)
评论(1) 编辑 收藏 引用