10-21-2016, 02:09 PM
Perfect, but some question to understand, and do better by myself later.
1. Tried to findout that, but missed it, know will know
DEFINE_DEVPROPKEY(DEVPKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
PROPERTYKEY pk.pid=14; memcpy &pk.fmtid uuidof("{a45c254e-df1c-4efd-8020-67d146a850e0}") sizeof(GUID)
2.
IMMDeviceEnumerator pEnumerator
IMMDeviceCollection pCollection
Why use create with pEnumerator and not with pCollection????
3. in MSDN,
pEndpoint.GetId waitsq for LPWSTR *ppstrId
Here, word*, why?
4. why this?
str s1.ansi(varName.pwszVal) s2.ansi(pwszID)
CoTaskMemFree(pwszID); pwszID=0; PropVariantClear &varName; pProps=0; pEndpoint=0
from MSDN example, there are no such variable casts, is it QM handling that impose such tricky ways?
1. Tried to findout that, but missed it, know will know
DEFINE_DEVPROPKEY(DEVPKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
PROPERTYKEY pk.pid=14; memcpy &pk.fmtid uuidof("{a45c254e-df1c-4efd-8020-67d146a850e0}") sizeof(GUID)
2.
IMMDeviceEnumerator pEnumerator
IMMDeviceCollection pCollection
Why use create with pEnumerator and not with pCollection????
3. in MSDN,
pEndpoint.GetId waitsq for LPWSTR *ppstrId
Here, word*, why?
4. why this?
str s1.ansi(varName.pwszVal) s2.ansi(pwszID)
CoTaskMemFree(pwszID); pwszID=0; PropVariantClear &varName; pProps=0; pEndpoint=0
from MSDN example, there are no such variable casts, is it QM handling that impose such tricky ways?