ICatalogManager3::GetCatalog Method [C++]
Use this method to retrieve a specified catalog from the Product Catalog System.
Definition
[C++]
HRESULT ICatalogManager3::GetCatalog(BSTRstrCatalogName,
IProductCatalog3**ppCatalog);
[Visual Basic]
Function GetCatalog(strCatalogName As String) As ProductCatalog
Parameters
- strCatalogName[C++]
[in] A BSTR that contains the name of the catalog to be retrieved. - strCatalogName[Visual Basic]
A String that contains the name of the catalog to be retrieved. - ppCatalog[C++]
[out] A pointer to an IProductCatalog3 interface used to return the ProductCatalog object.
Return Values
[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.
[Visual Basic] If this method completes successfully, it returns the ProductCatalog object that contains the catalog specified. The method may complete successfully and return an object that is Nothing. See the Error Values section for more details.
Error Values
[C++] This method returns S_OK (0x00000000) or S_FALSE (&H00000001) to indicate success and standard COM HRESULT error values, to indicate failure. This method may succeed and yet not return a valid output parameter. The output parameter(s) will be invalid if either and error value or S_FALSE is returned. For more information about standard COM errors, see Standard COM Errors.
[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) or S_FALSE (&H00000001) to indicate success and to either standard or custom COM error values to indicate failure. This method may succeed and yet return a property or object that is Nothing due to a syntax error, such as requesting a property or object that does not exist. Test the return value for Nothing before relying on it. For more information about standard COM errors, see Standard COM Errors.
The following table describes the custom COM errors this method can return.
Name | Value | Description |
---|---|---|
E_CAT_CATMGR_NOT_INITIALIZED | [C++] 0x889800B5 [Visual Basic] &H889800B5 |
The CatalogManager object has not been initialized. The CatalogManager object should be initialized before calling this method |
E_CAT_INVALID_CATALOGNAME | [C++] 0x88980063 [Visual Basic] &H88980063 |
The Catalog Name you specified is invalid. Catalog names cannot be blank |
E_CAT_INVALID_CATALOG_NAME_LENGTH | [C++] 0x88980042 [Visual Basic] &H88980042 |
The Catalog name you specified exceeds the maximum limit of 85 characters. |
E_CAT_CHARACTER_NOT_ALLOWED | [C++] 0x8898003D [Visual Basic] &H8898003D |
The catalog name you specified has one of the nine reserved characters:
" [ ] , ' ( )#. These characters should not be used. |
S_FALSE | [C++] 0x0000001 [Visual Basic] &H0000001 |
The catalog does not exist |
[C++] Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.
[Visual Basic] Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.
Remarks
[C++] The ppCatalog parameter contains valid data only if the method completes successfully. The method may complete successfully without returning valid data. See the Error Values section for more details.
[Visual Basic] The ProductCatalog object contains valid data only if the method completes successfully. The method may complete successfully and return an object that is Nothing. See the Error Values section for more details.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.
[Visual Basic]
Example
Set oCatalog = myCatalogManager.GetCatalog("Cdcatalog")
See Also
[Visual Basic]CatalogManager Object
[C++]ICatalogManager3::CreateCatalog
[Visual Basic]CatalogManager.CreateCatalog
[C++]ICatalogManager3::DeleteCatalog
[Visual Basic]CatalogManager.DeleteCatalog
Copyright © 2005 Microsoft Corporation.
All rights reserved.