#include <registry.h>
Inheritance diagram for ClassCategoryProbe:
Public Member Functions | |
ClassCategoryProbe () | |
This default constructor should be followed by a call to InitializeEnumerator() if you want it to work. | |
ClassCategoryProbe (const ClassCategoryProbe &OtherProbe) | |
This copy constructor stops any COM objects disappearing between copies. | |
~ClassCategoryProbe () | |
This destructor Releases any COM objects. | |
BOOL | Init () |
This is the second part of the two part constructor. It can fail. I wanted the names of Template handler/op things from the registry which are under CATID. | |
BOOL | GetNextEntry (ClassRegistryEntry *const pEntry) |
Does the enumeration returning the ClassRegistryEntry of the next class in the category. | |
BOOL | IsLast () const |
Determines when to finish the enumeration. | |
Protected Member Functions | |
BOOL | GetNextCLSID (CLSID *const pNextCLSID) |
Does the enumeration returning the CLSID of any classes that implement the Category for this probe. | |
ICatInformation * | CreateCatInformer () |
Support function to get us an instance of ICatInformation. Don't forget to Release it. | |
virtual const CATID & | GetCategoryID () const =0 |
Private Attributes | |
IEnumCLSID * | m_pEnumCLSID |
CLSID | m_NextCLSIDToReturn |
Static Private Attributes | |
static const String_256 | s_CLSIDKey |
Definition at line 357 of file registry.h.
|
This default constructor should be followed by a call to InitializeEnumerator() if you want it to work.
Definition at line 1536 of file registry.cpp. 01537 { 01538 m_pEnumCLSID = NULL; 01539 }
|
|
This copy constructor stops any COM objects disappearing between copies.
Definition at line 1665 of file registry.cpp. 01666 { 01667 m_pEnumCLSID = OtherProbe.m_pEnumCLSID; 01668 if (m_pEnumCLSID != NULL) 01669 { 01670 m_pEnumCLSID->AddRef(); 01671 } 01672 }
|
|
This destructor Releases any COM objects.
Definition at line 1685 of file registry.cpp. 01686 { 01687 if (m_pEnumCLSID != NULL) 01688 { 01689 m_pEnumCLSID->Release(); 01690 m_pEnumCLSID = NULL; 01691 } 01692 }
|
|
Support function to get us an instance of ICatInformation. Don't forget to Release it.
Definition at line 1634 of file registry.cpp. 01635 { 01636 HRESULT Result = S_OK; 01637 01638 ICatInformation* pCatInformer = NULL; 01639 01640 Result = CoCreateInstance( CLSID_StdComponentCategoriesMgr, //Class identifier (CLSID) of the object 01641 NULL, //Pointer to whether object is or isn't part of an aggregate 01642 CLSCTX_INPROC_SERVER, //Context for running executable code 01643 IID_ICatInformation, //Reference to the identifier of the interface 01644 (LPVOID*)&pCatInformer //Indirect pointer to requested interface 01645 ); 01646 if (FAILED(Result)) 01647 { 01648 TRACE( _T("ClassCategoryProbe::CreateCatInfoInterface failed with %x\n"), Result); 01649 } 01650 01651 return pCatInformer; 01652 }
|
|
Implemented in WizOpProbe. |
|
Does the enumeration returning the CLSID of any classes that implement the Category for this probe.
Definition at line 1738 of file registry.cpp. 01739 { 01740 HRESULT Result = S_OK; 01741 01742 *pNextCLSID = m_NextCLSIDToReturn; 01743 01744 if (m_pEnumCLSID != NULL) 01745 { 01746 Result = m_pEnumCLSID->Next(1, //Number of elements requested 01747 &m_NextCLSIDToReturn, //Array of the elements 01748 NULL //Pointer to the number of elements actually supplied 01749 ); 01750 } 01751 else 01752 { 01753 TRACE( _T("ClassCategoryProbe::operator++(INT32) - NULL m_pEnumCLSID\n")); 01754 Result = E_UNEXPECTED; 01755 } 01756 01757 if (Result == S_FALSE) 01758 { 01759 // That was the last one so make this the NULL probe 01760 m_pEnumCLSID->Release(); 01761 m_pEnumCLSID = NULL; 01762 } 01763 01764 return SUCCEEDED(Result); 01765 }
|
|
Does the enumeration returning the ClassRegistryEntry of the next class in the category.
Definition at line 1709 of file registry.cpp. 01710 { 01711 BOOL Ok = TRUE; 01712 01713 CLSID NextCLSID; 01714 Ok = GetNextCLSID(&NextCLSID); 01715 01716 if (Ok) 01717 { 01718 Ok = pEntry->InitFromCLSID(NextCLSID); 01719 } 01720 01721 return Ok; 01722 }
|
|
This is the second part of the two part constructor. It can fail. I wanted the names of Template handler/op things from the registry which are under CATID.
Definition at line 1565 of file registry.cpp. 01566 { 01567 // Don't try the enumeration more than once 'cos I haven't checked it will work 01568 ERROR2IF(m_pEnumCLSID != NULL, FALSE, "NULL Args"); 01569 01570 HRESULT Result = S_OK; 01571 01572 ICatInformation* const pCatInformer = CreateCatInformer(); 01573 if (pCatInformer == NULL) 01574 { 01575 Result = E_OUTOFMEMORY; 01576 } 01577 01578 // Create an enumerator for all the CLSIDs in the given component category 01579 if (SUCCEEDED(Result)) 01580 { 01581 CATID Implements = GetCategoryID(); 01582 01583 Result = pCatInformer->EnumClassesOfCategories( 01584 1, //Number of category IDs in the rgcatidImpl array 01585 &Implements, //Array of category identifiers 01586 0, //Number of category IDs in the rgcatidReq array 01587 &Implements, //Array of category identifiers 01588 &m_pEnumCLSID //Location in which to return an IEnumCLSID interface 01589 ); 01590 } 01591 01592 // Get rid of our local ICatInfo 01593 if (pCatInformer != NULL) 01594 { 01595 pCatInformer->Release(); 01596 } 01597 01598 // Get the first CLSID so it's returned by GetNextCLSID and IsLast works properly 01599 if (SUCCEEDED(Result)) 01600 { 01601 Result = m_pEnumCLSID->Next(1, //Number of elements requested 01602 &m_NextCLSIDToReturn, //Array of the elements 01603 NULL //Pointer to the number of elements actually supplied 01604 ); 01605 01606 if (Result == S_FALSE) 01607 { 01608 // There weren't any CLSIDs so make this the NULL probe 01609 m_pEnumCLSID->Release(); 01610 m_pEnumCLSID = NULL; 01611 } 01612 } 01613 01614 return SUCCEEDED(Result); 01615 }
|
|
Determines when to finish the enumeration.
Definition at line 1780 of file registry.cpp. 01781 { 01782 return m_pEnumCLSID == NULL; 01783 }
|
|
Definition at line 378 of file registry.h. |
|
Definition at line 377 of file registry.h. |
|
Definition at line 380 of file registry.h. |