CODE
HRESULT hr = S_OK;
CComPtr <IEnumMoniker> pEnum;
CComPtr <ICreateDevEnum> pSysDevEnum;
CComPtr <IMoniker> pMoniker;
hr = pSysDevEnum.CoCreateInstance(CLSID_SystemDeviceEnum)
hr = pSysDevEnum->CreateClassEnumerator(clsidDeviceClass, &pEnum, 0);
while(pEnum->Next(1, &pMoniker, 0) == S_OK)
{
LPOLESTR pStr;
IBindCtx *pBindCtx;
hr = CreateBindCtx(0, &pBindCtx);
hr = pMoniker->GetDisplayName(pBindCtx, NULL, &pStr);
pMoniker.Release();
}
pEnum.Release();
pSysDevEnum.Release();
CComPtr <IEnumMoniker> pEnum;
CComPtr <ICreateDevEnum> pSysDevEnum;
CComPtr <IMoniker> pMoniker;
hr = pSysDevEnum.CoCreateInstance(CLSID_SystemDeviceEnum)
hr = pSysDevEnum->CreateClassEnumerator(clsidDeviceClass, &pEnum, 0);
while(pEnum->Next(1, &pMoniker, 0) == S_OK)
{
LPOLESTR pStr;
IBindCtx *pBindCtx;
hr = CreateBindCtx(0, &pBindCtx);
hr = pMoniker->GetDisplayName(pBindCtx, NULL, &pStr);
pMoniker.Release();
}
pEnum.Release();
pSysDevEnum.Release();
graphedt.exe shows the full string in the insert filter dialog but when i run this code pStr always comes out with the end chopped off.
@device:pnp:\\?\pci#ven_109e&dev_036e&subsys_00011822&rev_11#3&61aaa01&0&40#{71985f48-1ca1-11d3-9cc8-00c04f7971e0}\{4e603
Has anyone else done this and had the same problem? or can you point out what i'm doing wrong?