Bewerken

Share via


COMAdminCatalogCollection class

Represents any collection in the COM+ catalog. Use it to enumerate, add, remove, and retrieve items in a collection and to access related collections.

When to implement

This class is implemented by COM+.

Requirement Value
Interfaces ICatalogCollection

When to use

Use objects created from the COMAdminCatalogCollection class when you want to programmatically manipulate a collection in the COM+ catalog. These collections correspond to folders in the Component Services administration tool. Items inside the folders correspond to items in collections, which you can represent by using objects created from the COMAdminCatalogObject class.

For information regarding the collections on the catalog and their properties, see COM+ Administration Collections.

For an introduction to programmatic administration of COM+, see Automating COM+ Administration.

Remarks

You cannot directly create a COMAdminCatalogCollection object. To use the methods this object, you must create a COMAdminCatalog object, obtain a reference to ICOMAdminCatalog, and then use ICOMAdminCatalog::GetCollection to get a reference to an ICatalogCollection interface that represents a top-level collection. This is shown in the following example, where "TopCollection" must be replaced by the name of one of the top-level COM+ administration collections.

    HRESULT hr = CoCreateInstance(CLSID_COMAdminCatalog, NULL, 
      CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pUnknown);
    if (FAILED (hr)) exit(0);  // Replace with specific error handling.
    hr = pUnknown->QueryInterface(IID_ICOMAdminCatalog, 
      (void**)&pCatalog); 
    if (FAILED (hr)) exit(0);  // Replace with specific error handling.
    hr = pCatalog->GetCollection(L"TopCollection", 
      (IDispatch**)&pTopColl);
    if (FAILED (hr)) exit(0);  // Replace with specific error handling.

To use this class from Microsoft Visual Basic, add a reference to the COM+ Admin Type Library. A COMAdminCatalogCollection object can be created by calling GetCollection on a COMAdminCatalog object. This is shown in the following example, where "TopCollection" must be replaced by the name of one of the top-level COM+ administration collections.

Dim objCatalog As COMAdmin.COMAdminCatalog
Set objCatalog = CreateObject("COMAdmin.COMAdminCatalog")
Dim objTopCollection As COMAdmin.COMAdminCatalogCollection
Set objTopCollection = objCatalog.GetCollection("TopCollection")

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
ComAdmin.h
IDL
ComAdmin.Idl

See also

COMAdminCatalog

COMAdminCatalogObject

ICatalogCollection