CATEGORYINFO & ICatRegister
-
I try to register a categoty using ATL/COM After registering the registry looks pretty OK. OleView diaplays the categoty In Left Tree Pane: Grouped by Ccategory (child tree list) I cannot se muy category, but in detailed right pane list-view I can see my category beeing there. The bad thing is when I enumerate the category info I cannot find it. All COM calls returrn S_OK; // here Is the registration code -------------------------------------------------- USES_CONVERSION; CComPtr catInfo; HRESULT hr = catInfo.CoCreateInstance(CLSID_StdComponentCategoriesMgr); if(FAILED(hr))return hr; // ensure the category registration CATEGORYINFO catinfo; catinfo.catid = MY_CATID; catinfo.lcid = 0x0409 ; ::wcscpy(catinfo.szDescription, T2W (catDescription)); catInfo->RegisterCategories(1, &catinfo); CComPtr catInfo; HRESULT hr = catInfo.CoCreateInstance(CLSID_StdComponentCategoriesMgr); if(FAILED(hr))return hr; CATID catid = catidIn; catInfo->RegisterClassImplCategories(CLSID_MyDLL,1,&catid); // here is the enumaration code -------------------------------------------------- CComPtr ci; HRESULT hr = ci.CoCreateInstance(CLSID_StdComponentCategoriesMgr); if(FAILED(hr)) return; CComPtr spEci; if(SUCCEEDED(ci->EnumCategories(GetUserDefaultLCID(), &spEci))) { ULONG nRet = 0; CATEGORYINFO cif; while(SUCCEEDED(spEci->Next(1,&cif,&nRet)) && nRet==1) { if (cif.catid == NY_CATID) { TRACE("found \r\n"); } } }
-
I try to register a categoty using ATL/COM After registering the registry looks pretty OK. OleView diaplays the categoty In Left Tree Pane: Grouped by Ccategory (child tree list) I cannot se muy category, but in detailed right pane list-view I can see my category beeing there. The bad thing is when I enumerate the category info I cannot find it. All COM calls returrn S_OK; // here Is the registration code -------------------------------------------------- USES_CONVERSION; CComPtr catInfo; HRESULT hr = catInfo.CoCreateInstance(CLSID_StdComponentCategoriesMgr); if(FAILED(hr))return hr; // ensure the category registration CATEGORYINFO catinfo; catinfo.catid = MY_CATID; catinfo.lcid = 0x0409 ; ::wcscpy(catinfo.szDescription, T2W (catDescription)); catInfo->RegisterCategories(1, &catinfo); CComPtr catInfo; HRESULT hr = catInfo.CoCreateInstance(CLSID_StdComponentCategoriesMgr); if(FAILED(hr))return hr; CATID catid = catidIn; catInfo->RegisterClassImplCategories(CLSID_MyDLL,1,&catid); // here is the enumaration code -------------------------------------------------- CComPtr ci; HRESULT hr = ci.CoCreateInstance(CLSID_StdComponentCategoriesMgr); if(FAILED(hr)) return; CComPtr spEci; if(SUCCEEDED(ci->EnumCategories(GetUserDefaultLCID(), &spEci))) { ULONG nRet = 0; CATEGORYINFO cif; while(SUCCEEDED(spEci->Next(1,&cif,&nRet)) && nRet==1) { if (cif.catid == NY_CATID) { TRACE("found \r\n"); } } }
I think in if comparision you have used NY_CATID. Previously it is MY_CATID. So verify it once.