Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CATEGORYINFO & ICatRegister

CATEGORYINFO & ICatRegister

Scheduled Pinned Locked Moved C / C++ / MFC
c++comwindows-admindata-structuresdebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    suiram40
    wrote on last edited by
    #1

    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"); } } }

    K 1 Reply Last reply
    0
    • S suiram40

      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"); } } }

      K Offline
      K Offline
      K ARUN KUMAR
      wrote on last edited by
      #2

      I think in if comparision you have used NY_CATID. Previously it is MY_CATID. So verify it once.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups